website-pages #2
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
| # Mayfly documentation website: build-check on PRs, build + deploy to GitHub | |
| # Pages on main (ADR D32). The custom domain serves Chinese at the site root | |
| # and English at /en/. | |
| name: website-pages | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - .github/workflows/website-pages.yml | |
| - website/** | |
| - package.json | |
| - pnpm-lock.yaml | |
| - pnpm-workspace.yaml | |
| # Branch protection requires Build check (PR) for every pull request, so | |
| # this event must not be path-filtered. | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| env: | |
| PRIMARY_NODE_VERSION: '24' | |
| jobs: | |
| # PR gate: full install + VitePress build. The build fails on dead links by | |
| # default (config sets no ignoreDeadLinks), so this catches breakage before | |
| # merge. No Pages permissions on PRs. | |
| check: | |
| name: Build check (PR) | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: website-check-${{ github.ref }} | |
| cancel-in-progress: true | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.PRIMARY_NODE_VERSION }} | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm --filter @ephemeral-ai/mayfly-website run build | |
| build: | |
| if: github.event_name != 'pull_request' | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: github-pages | |
| cancel-in-progress: false | |
| permissions: | |
| contents: read | |
| pages: read | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.PRIMARY_NODE_VERSION }} | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - uses: actions/configure-pages@v6 | |
| id: pages | |
| - run: pnpm --filter @ephemeral-ai/mayfly-website run build | |
| env: | |
| DOCS_BASE: / | |
| DOCS_SITE_URL: ${{ vars.DOCS_SITE_URL }} | |
| - uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: website/.vitepress/dist | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v5 |