github-actions[bot] is automatically releasing 🚀 #86
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
run-name: ${{ github.actor }} is automatically releasing 🚀 | |
on: | |
repository_dispatch: | |
types: | |
- release | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Generate token' | |
id: generate_token | |
uses: tibdex/github-app-token@v2 | |
with: | |
app_id: ${{ secrets.BOT_APP_ID }} | |
private_key: ${{ secrets.BOT_PRIVATE_KEY }} | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ steps.generate_token.outputs.token }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: latest | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- uses: vimtor/action-zip@v1 | |
with: | |
files: package.json package-lock.json dist/ | |
dest: dist.zip | |
- name: Semantic Release | |
env: | |
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npx semantic-release | |
merge: | |
needs: [release] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Merge main back into dev | |
uses: devmasx/merge-branch@v1.4.0 | |
with: | |
type: now | |
head_to_merge: main | |
target_branch: dev | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_docs: | |
needs: [release] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: main | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: latest | |
- run: npm ci | |
- name: Build documentation | |
env: | |
NODE_ENV: production | |
NODE_OPTIONS: --max-old-space-size=4096 --openssl-legacy-provider | |
run: npm run docs:build | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs/.vuepress/dist | |
cname: node-hypixel.zikeji.com |