Repository navigation
chore: update package.json to include onlyBuiltDependencies for pnpm … #16
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: Deploy to GitHub Pages | |
| on: | |
| push: | |
| branches: [rel/v1] | |
| jobs: | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup pnpm # 先安装 pnpm | |
| uses: pnpm/action-setup@v4 # 使用最新 v4 版本 | |
| with: | |
| version: 10 # 约束 pnpm 大版本为 10.x,避免 latest 升级破坏部署 | |
| - name: Setup Node.js # 再设置 Node,这时 pnpm 已可用 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'pnpm' # 现在可以安全地使用 pnpm 缓存 | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build | |
| run: pnpm build | |
| - name: Config github pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: "./dist" | |
| - name: Deploy to github pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |