ci: replace docs/v* branches with tags for versioned docs deployment#511
Open
ci: replace docs/v* branches with tags for versioned docs deployment#511
Conversation
Switch versioned docs from branch-based to tag-based deployment. Previously, both release tags (v*) and docs/v* branches triggered the publish-versioned-docs job in docs.yml, deploying to the same /X.Y/ path. This created a silent drift problem: the docs/v* branch could accumulate commits independently of releases, causing the live docs to diverge from the released version without any guardrail. The fix has two parts: 1. docs.yml: remove docs/v* from branch triggers; add docs/v* to tag triggers. The publish-versioned-docs job now fires only on release tags (v*) and docs-override tags (docs/v*). Tags require a deliberate force-push to move, making any docs redeploy an explicit, intentional act. 2. sync-docs-tag.yml (new): after each release tag push, automatically create or force-move the docs/vX.Y tag to that same commit. This keeps the tag in sync with the latest patch so docs-only cherry-picks always start from the right base. Because GITHUB_TOKEN pushes do not trigger other workflow runs, moving the tag here does NOT re-trigger docs.yml — no skip guards needed. Also documents the docs-only fix workflow (merge to main first, then cherry-pick to a local temp branch and force-move the tag) in docs-guidelines.md, and adds rollback steps for the docs/vX.Y tag to the release playbook. Migration: after this merges, create the docs/v0.2 tag from the current docs/v0.2 branch tip, then delete the branch: git fetch origin git tag docs/v0.2 origin/docs/v0.2 git push origin refs/tags/docs/v0.2 git push origin --delete docs/v0.2
047ba71 to
acb5af3
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Replaces
docs/v*branches withdocs/v*tags as the mechanism for controlling versioned documentation deployments, and adds automation to keep them in sync after every release.The problem with branches
Both
v*release tags anddocs/v*branches triggered the samepublish-versioned-docsjob and deployed to the same/X.Y/folder. Branches drift silently — a routine push to a staledocs/v0.2branch overwrites the live docs with older content, with no warning. This happened in practice:docs/v0.2sat at its March 30 state while the live/0.2/was correctly deployed from the April 8v0.2.3tag. Automating a branch-based sync (PR #510) required branch protection bypass configuration and still produced merge conflicts.Why tags
Tags are immutable by convention. Moving one requires a deliberate
git push --force— it cannot happen accidentally. No branch protection rules apply, so no bypass configuration is needed.How versioned docs work after this PR
Triggers (changed)
v0.2.3release tag pushed/0.2//0.2/(unchanged)docs/v0.2branch pushed/0.2/docs/v0.2tag pushed or force-moved/0.2/Automatic sync on every release
Two workflows run concurrently when a release tag is pushed:
GitHub prevents recursive workflow runs from
GITHUB_TOKENpushes by design, so the tag move never causes a second deployment.Doing a docs-only fix between releases
The rule: always merge the fix to
mainfirst. Thedocs/vX.Ytag is only for immediate deployment — when the next patch is released,sync-docs-tag.ymlresetsdocs/vX.Yto the release commit. Any commit that exists only on the tag (not inmain) will be lost at that point.Workflow for an immediate re-deploy of
/0.2/:The commits remain reachable via the tag — no remote branch is ever pushed.
Files changed
.github/workflows/docs.ymldocs/v*branch → tag (+ !docs/v*-*); version extraction and job condition updated torefs/tags/docs/v.github/workflows/sync-docs-tag.ymldocs/vX.Ytag to the release commit after each release tag pushdocs-site/README.mdGITHUB_TOKENbehavior explained.claude/docs-guidelines.mdmainbefore the next release.claude/skills/release/task6-docs.mddocs.yml+sync-docs-tag.yml); cross-references docs guidelines.claude/skills/release/rollback.mddocs/vX.Ytag; Task 6 rollback: clarified that tag cleanup belongs to Task 2Migration: after this PR merges
Two
docs/v*branches currently exist (docs/v0.1,docs/v0.2). Neither will trigger deployments after this merges. Tag each at its current branch tip, then delete the branches:The live
/0.1/and/0.2/docs are unaffected — already correctly deployed ondocs-deployment.Test plan
docs/v0.1anddocs/v0.2sync-docs-tag.ymlruns and movesdocs/vX.Yto the release commitdocs.ymlis not re-triggered by thesync-docs-tag.ymltag movedocs/v0.2to a test commit and verifydocs.ymlis triggered and redeploys/0.2/docs/v*branch pushes no longer triggerpublish-versioned-docs