Skip to content

ci: deploy docs on release instead of every push to main#315

Merged
btravers merged 2 commits into
mainfrom
ci/deploy-docs-on-release
Jul 14, 2026
Merged

ci: deploy docs on release instead of every push to main#315
btravers merged 2 commits into
mainfrom
ci/deploy-docs-on-release

Conversation

@btravers

Copy link
Copy Markdown
Collaborator

What

Docs currently deploy on every successful CI run on main (via workflow_run), so the published site tracks unreleased main — not the latest released version.

This switches the trigger to release: published (plus workflow_dispatch for manual redeploys). changesets already creates a GitHub Release when it publishes, and the release event checks out the release tag's commit, so the docs match the released code.

Effect

  • Docs redeploy only when a version is released, not on every merge.
  • Between releases, main can move without stale-ifying or churning the published docs.
  • A docs-only fix can still be shipped immediately via the manual Run workflow button.

🤖 Generated with Claude Code

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) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 14, 2026 16:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the documentation deployment workflow so the published GitHub Pages site tracks the most recently released code (via GitHub Releases) rather than tracking every successful merge to main.

Changes:

  • Switch docs deploy trigger from workflow_run (CI on main) to release: published.
  • Keep workflow_dispatch as a manual redeploy option.
  • Remove the prior if: gate that depended on workflow_run payload fields.

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) <noreply@anthropic.com>
@btravers

Copy link
Copy Markdown
Collaborator Author

Addressed the review in a follow-up commit:

  • Removed workflow_dispatch. It defaults to running on main, so a manual run would deploy unreleased docs to production — the exact problem this PR fixes. A failed Pages deploy can still be re-run via GitHub's Re-run jobs on the release run, which preserves the release tag's commit as the checkout context.
  • concurrency.cancel-in-progress: true. A version bump that publishes several Releases at once (each firing release: published for the same commit) now collapses into a single Pages deploy instead of N identical ones — repo-agnostic, and robust even for independently-versioned packages (no fragile per-package tag gate that could skip a deploy).

Now strictly on: release: [published].

@btravers btravers merged commit b3c0433 into main Jul 14, 2026
10 checks passed
@btravers btravers deleted the ci/deploy-docs-on-release branch July 14, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants