fix: 又忘记格式化了 #28
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
| # 构建 VitePress 站点并部署到 GitHub Pages | |
| name: Deploy VitePress site to Pages | |
| on: | |
| push: | |
| branches: [dev] | |
| paths: | |
| - "docs/**" | |
| - "package.json" | |
| - "pnpm-lock.yaml" | |
| - ".github/workflows/docs.yml" | |
| workflow_dispatch: | |
| # 允许部署到 GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # 同一时间只允许一个部署,不取消正在进行的生产部署 | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@v6 | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| # 文档构建无需原生模块,跳过 postinstall(electron-rebuild) | |
| - name: Install dependencies | |
| run: pnpm install --ignore-scripts | |
| - name: Build with VitePress | |
| run: pnpm run docs:build | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: docs/.vitepress/dist | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| needs: build | |
| runs-on: ubuntu-latest | |
| name: Deploy | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |