ci: fix multiversion docs deployment#267
Merged
Merged
Conversation
Three bugs prevented correct docs deployment to GitHub Pages: 1. DOCS_MAX_VERSIONS was referenced in the tag-build prune loop but never defined, causing a bash syntax error on every release tag push. Added the env var to the build job and a bash fallback. 2. The publish job ran on the self-hosted Linux runner, but actions/deploy-pages@v4 requires OIDC token support which is only guaranteed on GitHub-hosted runners. Moved publish to ubuntu-latest. 3. Main-branch pushes now correctly preserve all cached version dirs and only rebuild the main/ subdirectory. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Description
This PR fixes three bugs that prevented the multiversion docs from deploying correctly to GitHub Pages.
Bug 1 —
DOCS_MAX_VERSIONSundefined (tag builds crashed):The bash prune loop at line 92 referenced
${DOCS_MAX_VERSIONS}but the variable was never set in the build job environment. On every release tag push, bash hit[[ N -gt ]]→ syntax error, failing the build step. Fixed by addingDOCS_MAX_VERSIONS: 5to the build job env and a${DOCS_MAX_VERSIONS:-5}bash fallback.Bug 2 —
publishjob on self-hosted runner (OIDC unavailable):actions/deploy-pages@v4requires OIDC token generation to authenticate with the GitHub Pages API. This is only guaranteed on GitHub-hosted runners (ubuntu-latest). The self-hostedLinuxrunner does not support OIDC, causing the deploy step to fail. Fixed by changingpublish.runs-ontoubuntu-latest. The heavy build job still correctly uses the GPU container.Bug 3 — Main pushes overwriting release docs (already addressed in prior PRs):
The cache-based approach from #263 and #266 is sound — this PR preserves it as-is. Main pushes restore the full cached site, rebuild only
main/, and save back. Release docs are never touched by main pushes.Type of change
Checklist
black .command to format the code base.🤖 Generated with Claude Code