From b798adca603db27f7272bc8aee7487f81def2898 Mon Sep 17 00:00:00 2001 From: Christian Bager Bach Houmann Date: Tue, 22 Sep 2026 19:20:38 +0200 Subject: [PATCH] ci: build and link-check the docs site on every PR --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ docs/README.md | 5 +++++ 2 files changed, 41 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd6232f3..3a37524a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,3 +106,39 @@ jobs: run: pnpm run build-with-lint - name: Svelte check run: pnpm run check + + # Builds the docs site the way Cloudflare Pages does (docs/.node-version, + # frozen docs lockfile) and checks internal links and anchors. Cloudflare + # skips Dependabot previews, so this is the only build a docs dependency + # bump gets before merge. Runs on every PR so it can be a required check. + docs: + name: Docs + runs-on: ubuntu-latest + defaults: + run: + working-directory: docs + steps: + - name: Harden Runner + uses: step-security/harden-runner@e14015d583714f6e62063499dc959a02595150a1 # v2.21.1 + with: + egress-policy: audit + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Setup pnpm + uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 + with: + package_json_file: docs/package.json + - name: Use Node.js from docs/.node-version + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version-file: docs/.node-version + cache: pnpm + cache-dependency-path: docs/pnpm-lock.yaml + - name: Install dependencies + run: pnpm install --frozen-lockfile + - name: Build site + run: pnpm run build + - name: Check links and anchors + run: python3 scripts/check-links.py diff --git a/docs/README.md b/docs/README.md index b6c6c9ae..1db26ad8 100644 --- a/docs/README.md +++ b/docs/README.md @@ -57,6 +57,11 @@ while an earlier one runs or is queued; a normal build takes about two minutes. Cloudflare does not update its PR comment after the PR is closed, so a comment still reading "Build in progress" on a merged PR is expected. +The required "Docs" check in GitHub CI (`.github/workflows/ci.yml`) builds the +site the same way on every PR (`.node-version`, frozen lockfile) and runs +`scripts/check-links.py`, so a broken docs build is caught before merge, even +on branches Cloudflare does not preview. + Docs are single-version: pages go live when they land on `master`. When documenting a feature that has not shipped in a plugin release yet, add an `_Introduced in QuickAdd X.Y.Z._` line at the section (see AGENTS.md).