Repository navigation
pages #36
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
| # Public release: build the static artifact and publish it to GitHub | |
| # Pages. Versioned releases come from tags (v*); the original-data | |
| # boundary holds — only the app shell is ever published. | |
| name: pages | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| # Full history so `git describe` can name the nearest release tag. | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: npm | |
| cache-dependency-path: package-lock.json | |
| - name: Use pinned npm | |
| run: npm install --global npm@11.6.2 | |
| - name: Install | |
| run: npm ci | |
| - name: Install Chromium for Playwright | |
| run: npx playwright install --with-deps chromium | |
| - name: Data-free release gates | |
| run: npm test && npm run check:boundaries && npm run test:release:static && npm run test:docs | |
| - name: Build release artifact | |
| run: npm run build:web | |
| - name: Stamp version | |
| run: | | |
| # The nearest release tag (v*), or empty for a dispatch off a | |
| # branch. The app shows tag · short-commit so serfbound.com tells | |
| # you exactly which build it is serving. | |
| export SERFBOUND_TAG="$(git describe --tags --match 'v*' --abbrev=0 2>/dev/null || true)" | |
| node -e ' | |
| const fs = require("fs"); | |
| fs.writeFileSync("dist/version.json", JSON.stringify({ | |
| version: process.env.GITHUB_REF_NAME || "dev", | |
| tag: process.env.SERFBOUND_TAG || undefined, | |
| commit: process.env.GITHUB_SHA || "", | |
| builtAtIso: new Date().toISOString(), | |
| }) + "\n"); | |
| ' | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: dist | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |