build(build): v3.0.6 #9
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: 部署VitePress | |
on: | |
push: | |
branches: ['main'] | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: main # 这一步检查 main 代码 | |
- name: Setup Node.js and pnpm | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.10.0' # 设置 nodejs 的版本 | |
- name: Build | |
run: | | |
npm i -g pnpm | |
pnpm install | |
pnpm run build:docs | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.DEPLOY }} | |
publish_dir: docs/.vitepress/dist # 指定该文件夹中的 dist | |
publish_branch: gh-pages # 推送到关联仓库的 gh-pages 分支 |