From 0c7431f98062178241f89fa623f526e76363897e Mon Sep 17 00:00:00 2001 From: Benoit TRAVERS Date: Tue, 14 Jul 2026 18:31:26 +0200 Subject: [PATCH 1/2] ci: deploy docs on release instead of every push to main Deploy the documentation site when a version is released instead of on every push to main, so the published docs describe the latest *released* library rather than unreleased main. changesets already creates a GitHub Release on publish, so trigger on `release: published` (the release tag's commit is checked out, matching the released code). `workflow_dispatch` stays as a manual redeploy escape hatch for docs-only fixes between releases. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/deploy-docs.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 1d99a28..8d81ad9 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -1,12 +1,11 @@ name: Deploy Documentation +# Publish docs when a version is released (changesets creates a GitHub Release on publish), so the +# site documents the latest *released* library rather than every commit on main. `workflow_dispatch` +# is a manual redeploy escape hatch for docs-only fixes between releases. on: - workflow_run: - workflows: ["CI"] - types: - - completed - branches: - - main + release: + types: [published] workflow_dispatch: permissions: @@ -25,7 +24,6 @@ jobs: build: runs-on: ubuntu-latest timeout-minutes: 15 - if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} steps: - name: Checkout uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 From 792d8d5888b051f34d73c1311aafad4337498135 Mon Sep 17 00:00:00 2001 From: Benoit TRAVERS Date: Tue, 14 Jul 2026 19:01:50 +0200 Subject: [PATCH 2/2] ci: drop workflow_dispatch and collapse duplicate release deploys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Address review: - Remove workflow_dispatch. It defaults to running on main, which would deploy *unreleased* docs to production — reintroducing the problem this change fixes. A failed Pages deploy can be re-run via GitHub's "Re-run jobs" on the release run, which keeps the release tag's commit as the checkout context. - Set concurrency cancel-in-progress: true so a version bump that publishes several Releases at once (each firing release: published for the same commit) collapses into a single Pages deploy instead of N identical ones. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/deploy-docs.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 8d81ad9..2f7cff0 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -1,12 +1,10 @@ name: Deploy Documentation # Publish docs when a version is released (changesets creates a GitHub Release on publish), so the -# site documents the latest *released* library rather than every commit on main. `workflow_dispatch` -# is a manual redeploy escape hatch for docs-only fixes between releases. +# site documents the latest *released* library rather than every commit on main. on: release: types: [published] - workflow_dispatch: permissions: contents: read @@ -14,8 +12,10 @@ permissions: id-token: write concurrency: + # A version bump can publish several Releases at once (monorepo); collapse that burst of events + # for the same commit into a single Pages deploy — the latest run cancels earlier ones. group: pages - cancel-in-progress: false + cancel-in-progress: true env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true