v0.0.9 #9
Workflow file for this run
This file contains hidden or 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 | |
on: | |
release: | |
types: [created] # 标识在创建新的 Release 时触发 | |
permissions: | |
contents: write | |
packages: write | |
jobs: | |
build-zh: | |
name: "release" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node.js and pnpm | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.16.0' # 设置 nodejs 的版本 | |
- name: Check file list | |
run: ls -a | |
- name: Install dependencies | |
run: npm install | |
- name: Build VitePress | |
run: npm run build:zh # 这里是打包 vitepress 命令 | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} # 这一步很重要,单独看下面的大步骤,主要是用来给该脚本一些仓库权限 | |
publish_dir: packages/zh/.vitepress/dist # 指定该文件夹中的 dist | |
publish_branch: gh-pages # 推送到关联仓库的 gh-pages 分支 | |
dotfiles: true # 包括在提交中,即使被 .gitignore 文件忽略 |