ci: auto-sync docs/vX.Y branch when a release tag is pushed#510
Closed
ci: auto-sync docs/vX.Y branch when a release tag is pushed#510
Conversation
Adds sync-docs-branch.yml workflow that opens a PR to reset docs/vX.Y to the new tag whenever a v* release is tagged. Prevents the branch from drifting behind the latest patch and avoids silently overwriting live docs if someone pushes a hotfix to a stale branch. Updates the release playbook (task6-docs.md) to document the new automated PR and when to merge it.
Member
Author
|
Closing in favor of a cleaner approach: replacing |
5 tasks
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.
Summary
Adds automation to keep `docs/vX.Y` branches in sync with release tags, and prevents a redundant docs re-deployment after the sync.
Files changed:
The problem
Both `v*` tags and `docs/v*` branches trigger the same `publish-versioned-docs` job and deploy to the same `/X.Y/` folder on the live site. Without sync automation, `docs/vX.Y` silently drifts behind the tag — and any future push to it (e.g. a docs hotfix) would overwrite the live docs with older content. This happened: `docs/v0.2` was sitting at its March 30 state while the live `/0.2/` docs were correctly deployed from the April 8 `v0.2.3` tag.
How it works
sync-docs-branch.ymlTriggers on every `v*` release tag push (pre-release tags excluded via `!v*-*`).
The force-push is an atomic reset — no merge commits, no conflict resolution, no manual steps. The branch ends up pointing exactly at the tag commit.
Skip guard in
docs.ymlThe force-push to `docs/vX.Y` triggers `docs.yml` again (because docs files changed). Without a guard, `publish-versioned-docs` would re-deploy content that is identical to what was just deployed from the tag — wasting CI minutes.
The added condition:
skips `publish-versioned-docs` only when `github-actions[bot]` pushes to `docs/v*`. It does not affect:
Sequence for a release tag push
This workflow will fail until configured:
GitHub → Settings → Branches → protection rule for `docs/v*`:
Without this, the `git push --force` step exits with
"Cannot force-push to this branch".Behavior table
Test plan