Deploy GitHub Pages #35
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
| # --------------------------------------------------------------------------- | |
| # pages.yml — Deploy the Vitepress SSG site to GitHub Pages | |
| # | |
| # Triggered on pushes to the web or data branches, or via workflow_dispatch. | |
| # Checks out both branches, builds the Vitepress site with Node 20, and | |
| # publishes to GitHub Pages. | |
| # --------------------------------------------------------------------------- | |
| name: Deploy GitHub Pages | |
| on: | |
| workflow_call: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - web | |
| - data | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: web | |
| path: web | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: data | |
| path: web/data | |
| continue-on-error: true | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v6 | |
| with: | |
| version: 10 | |
| - name: Install dependencies | |
| working-directory: web | |
| run: pnpm install --frozen-lockfile | |
| - name: Build Vitepress site | |
| working-directory: web | |
| env: | |
| BASE_URL: /${{ github.event.repository.name }}/ | |
| VITE_GITHUB_REPO_URL: ${{ github.server_url }}/${{ github.repository }} | |
| run: pnpm run build | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v6 | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: web/.vitepress/dist | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |