ci: 修复网站构建工作流错误 (#481) #3
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 site" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: deploy-site | |
| cancel-in-progress: true | |
| jobs: | |
| build-docs: | |
| name: Build docs | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| steps: | |
| - uses: actions/checkout@v6 | |
| name: Checkout repository | |
| - name: Setup Github Pages | |
| uses: actions/configure-pages@v6 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Build docs | |
| run: bun nx build docs | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: packages/docs/dist | |
| deploy-docs: | |
| name: Deploy site | |
| runs-on: ubuntu-latest | |
| needs: build-docs | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to Github Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |