Skip to content

ci: add versioned docs with PR previews via gh-pages#10

Merged
TaiSakuma merged 1 commit intomainfrom
dev
Mar 21, 2026
Merged

ci: add versioned docs with PR previews via gh-pages#10
TaiSakuma merged 1 commit intomainfrom
dev

Conversation

@TaiSakuma
Copy link
Owner

Summary

  • Switch from actions/deploy-pages (whole-site overwrite) to pushing subdirectories on a gh-pages branch
  • Deploy /dev/ on push to main, /<version>/ + /latest/ + root index.html on tag push
  • Deploy /pr/<number>/ on PR open/update with a preview comment, clean up on PR close
  • Extract shared deploy logic into a reusable composite action
  • Add scripts/override_site_url.py using tomlkit to override site_url for subdirectory builds

Test plan

  • Push to main/dev/ deployed on gh-pages
  • Create a PR → /pr/<number>/ deployed, comment with preview URL appears
  • Push to PR → preview updated, comment updated (not duplicated)
  • Close PR → /pr/<number>/ removed
  • Push tag v0.1.0/0.1.0/, /latest/, and root index.html deployed
  • GitHub Pages source set to "Deploy from a branch" → gh-pages (already done via API)

🤖 Generated with Claude Code

Switch from actions/deploy-pages (whole-site overwrite) to pushing
subdirectories on a gh-pages branch. This enables versioned release
docs, dev docs from main, and PR preview deployments.

- Rewrite docs.yml to deploy /dev/ on push to main
- Add docs-release.yml for /<version>/ + /latest/ + index.html on tag
- Add docs-pr-preview.yml for /pr/<number>/ with PR comment
- Add docs-pr-cleanup.yml to remove previews on PR close
- Extract shared deploy logic into composite action
- Add override_site_url.py script using tomlkit

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Contributor

@TaiSakuma TaiSakuma changed the title Add versioned docs with PR previews via gh-pages ci: add versioned docs with PR previews via gh-pages Mar 21, 2026
@github-actions github-actions bot added the ci CI configuration label Mar 21, 2026
@TaiSakuma TaiSakuma merged commit 46a23fb into main Mar 21, 2026
4 of 5 checks passed
@TaiSakuma TaiSakuma deleted the dev branch March 21, 2026 18:15
github-actions bot added a commit that referenced this pull request Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI configuration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant