feat(site): host the repository's docs, rendered at build time (phase 3) #7
Workflow file for this run
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: Site | |
| # The site at tmhsdigital.github.io/plumbline carries a JavaScript | |
| # reimplementation of the calibration floor. If it disagrees with the Python, | |
| # the site misreports the tool, which is worse than having no site. This | |
| # workflow holds the two together. The site is assembled inside this job, and | |
| # the deploy job (not yet added) will need it, so a wrong calculator or a | |
| # broken doc never ships. A stale site is the better failure. | |
| # | |
| # It is deliberately separate from ci.yml and release.yml: it shares no jobs, | |
| # no concurrency group, and no permissions with either. | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: site-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| parity: | |
| name: the site's floor agrees with the Python | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: "3.13" | |
| enable-cache: true | |
| - name: Sync dependencies | |
| run: uv sync --locked | |
| # Without this, a change to the Python floor would leave the JavaScript | |
| # agreeing with an old answer and the check below passing. | |
| - name: The committed fixture is what the Python produces today | |
| run: uv run python scripts/floor_golden.py --check | |
| # The renderer's refusals (raw HTML off the allowlist, broken links and | |
| # anchors, remote images, a modified vendored file) each have a case. | |
| - name: The doc renderer refuses what it should | |
| run: node scripts/render_docs.mjs --self-test | |
| # Regenerates the worked example from the mock adapter, by the command | |
| # docs/example-report.md records, and refuses if the report is stale. | |
| # Renders the repository's docs from this commit, and refuses on a broken | |
| # link or anchor, or raw HTML outside the allowlist. | |
| - name: Assemble the site | |
| run: uv run python scripts/build_site.py --out _site | |
| # The runner's own Node, with no setup action and no package install. | |
| # The check uses the standard library only. Given the built example, it | |
| # also requires the page to derive the report's ECE line exactly. | |
| - name: floor.js reproduces the fixture and the example report | |
| run: | | |
| node --version | |
| node scripts/check_floor_parity.mjs _site/example-run.json |