docs: 增强 app.throw/fetch 重试/logger 存储/部署/database 文档 #14
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
| # ───────────────────────────────────────────────────────────── | |
| # VextJS 文档站 — GitHub Pages 自动部署 | |
| # | |
| # 触发条件: | |
| # - push 到 main 分支(仅 website/ 目录变更时触发) | |
| # - 手动触发(workflow_dispatch) | |
| # | |
| # 流水线结构: | |
| # 1. build — 在 website/ 目录安装依赖并执行 rspress build | |
| # 2. deploy — 将 website/dist/ 部署到 GitHub Pages | |
| # | |
| # 首次使用前需在仓库 Settings → Pages 中将 Source 设置为 | |
| # "GitHub Actions"(而非 branch 部署) | |
| # | |
| # @see website/package.json §scripts | |
| # @see https://rspress.dev/guide/start/deploy | |
| # ───────────────────────────────────────────────────────────── | |
| name: Deploy Docs | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "website/**" | |
| - ".github/workflows/docs.yml" | |
| workflow_dispatch: | |
| # 同一分支同时只允许一个部署运行,新运行会取消旧运行 | |
| concurrency: | |
| group: pages-${{ github.ref }} | |
| cancel-in-progress: true | |
| # GitHub Pages 部署所需权限 | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # ── Jobs ───────────────────────────────────────────────────── | |
| jobs: | |
| # ──────────────────────────────────────────────────────────── | |
| # 1. 构建文档站 | |
| # ──────────────────────────────────────────────────────────── | |
| build: | |
| name: Build Docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # 获取完整提交历史,rspress lastUpdated 功能需要 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: "npm" | |
| cache-dependency-path: website/package-lock.json | |
| - name: Setup GitHub Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Install dependencies | |
| working-directory: website | |
| run: npm ci | |
| - name: Build | |
| working-directory: website | |
| run: npm run build | |
| env: | |
| NODE_ENV: production | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: website/dist | |
| # ──────────────────────────────────────────────────────────── | |
| # 2. 部署到 GitHub Pages | |
| # ──────────────────────────────────────────────────────────── | |
| deploy: | |
| name: Deploy to GitHub Pages | |
| runs-on: ubuntu-latest | |
| needs: build | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| - name: Print deployment URL | |
| run: | | |
| echo "✅ 文档站已部署至: ${{ steps.deployment.outputs.page_url }}" |