ci: try to fix build with updated Chrome version (pin to 151.0.7922.77) #64
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
| name: Deploy docs to Pages | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'docs/**' | |
| - 'docs-site/**' | |
| - '.github/workflows/deploy-docs.yml' | |
| # Build + test docs changes before merge. The deploy job is skipped on PRs. | |
| pull_request: | |
| paths: | |
| - 'docs/**' | |
| - 'docs-site/**' | |
| - '.github/workflows/deploy-docs.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # One deployment at a time; let an in-flight deploy finish. Keyed by ref so PR | |
| # validation runs never queue behind (or block) a main deploy. | |
| concurrency: | |
| group: pages-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: docs-site | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| # 24 to match mise.toml; the test scripts are TypeScript run directly | |
| # by `node --test` via native type stripping (needs 22.18+). | |
| node-version: 24 | |
| cache: npm | |
| cache-dependency-path: docs-site/package-lock.json | |
| - name: Install Chrome (for mermaid prerender) | |
| id: chrome | |
| uses: browser-actions/setup-chrome@v2 | |
| with: | |
| # Pinned: 151.0.7922.138 (the "stable" build as of 2026-08-12) crashes | |
| # mid-render on ARCHITECTURE.md's mermaid diagram in headless mode | |
| # (ConnectionClosedError on page.close — Chrome regression, not our | |
| # config). 151.0.7922.77 is the last build confirmed working in CI. | |
| chrome-version: 151.0.7922.77 | |
| - name: Puppeteer config (--no-sandbox for CI Chrome) | |
| # --disable-dev-shm-usage: CI containers give /dev/shm only 64MB, too | |
| # small for Chrome's shared memory renderer on larger mermaid diagrams | |
| # (e.g. ARCHITECTURE.md) — it crashes mid-render, surfacing as | |
| # ConnectionClosedError from mmdc/puppeteer instead of an OOM message. | |
| run: echo '{"args":["--no-sandbox","--disable-setuid-sandbox","--disable-dev-shm-usage"]}' > puppeteer.json | |
| - name: Install deps | |
| run: npm ci | |
| env: | |
| # Chrome comes from setup-chrome; skip puppeteer's own download. | |
| PUPPETEER_SKIP_DOWNLOAD: 'true' | |
| - name: Test | |
| run: npm run test | |
| env: | |
| PUPPETEER_EXECUTABLE_PATH: ${{ steps.chrome.outputs.chrome-path }} | |
| MMDC_PUPPETEER_CONFIG: ${{ github.workspace }}/docs-site/puppeteer.json | |
| - name: Build | |
| run: npm run build | |
| env: | |
| PUPPETEER_EXECUTABLE_PATH: ${{ steps.chrome.outputs.chrome-path }} | |
| MMDC_PUPPETEER_CONFIG: ${{ github.workspace }}/docs-site/puppeteer.json | |
| # Build already ran above; test:build would rebuild, so run the three | |
| # layers that read build/ instead. A failure here blocks the deploy. | |
| - name: Test | |
| run: npm run test:links && npm run test:content && npm run test:output | |
| - uses: actions/configure-pages@v6 | |
| if: github.event_name != 'pull_request' | |
| - uses: actions/upload-pages-artifact@v5 | |
| if: github.event_name != 'pull_request' | |
| with: | |
| path: docs-site/build | |
| deploy: | |
| needs: build | |
| if: github.event_name != 'pull_request' | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v5 |