Skip to content

Update deployment branch in GitHub Actionsfix: correct pnpm setup ord… #4

Update deployment branch in GitHub Actionsfix: correct pnpm setup ord…

Update deployment branch in GitHub Actionsfix: correct pnpm setup ord… #4

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches: [rel/v1]
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Setup pnpm # 先安装 pnpm
uses: pnpm/action-setup@v4 # 使用最新 v4 版本
with:
version: latest # 自动使用最新版本
- name: Setup Node.js # 再设置 Node,这时 pnpm 已可用
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm' # 现在可以安全地使用 pnpm 缓存
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/rel/v1' # 确保只在 main 分支部署
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist