docs: add /next-version-preview/ subpath via gh-pages branch#255
Closed
adamziel wants to merge 1 commit into
Closed
docs: add /next-version-preview/ subpath via gh-pages branch#255adamziel wants to merge 1 commit into
adamziel wants to merge 1 commit into
Conversation
The docs site can now host two slots side by side: https://wordpress.github.io/php-toolkit/ ← trunk https://wordpress.github.io/php-toolkit/next-version-preview/ ← latest preview Both live on a single `gh-pages` branch: gh-pages:/ trunk site (root) gh-pages:/next-version-preview/ whichever branch was most-recently built by docs-preview.yml Mechanism: - docs.yml stops using actions/upload-pages-artifact + actions/deploy-pages (which replace the entire site on every deploy) and switches to peaceiris/actions-gh-pages@v4 with `keep_files: true`. Trunk pushes to the branch root and leaves the preview directory untouched. - docs-preview.yml is new: triggered manually (workflow_dispatch with a `ref` input) or by pushing to a `preview/*` branch namespace. It rebuilds the docs site from the chosen ref, then peaceiris publishes to `gh-pages/next-version-preview/` with destination_dir scoping so only that subfolder is replaced. - If the previewed ref has an open PR, the workflow drops a comment with the preview URL on it. Concurrency group `gh-pages` is shared between both workflows so two deploys can't race for the same branch (`cancel-in-progress: false` queues them rather than dropping work). Build steps tolerate either build-docs.py or build-reference.py being absent so the workflows keep working through the catalog refactor (the markdown-source PR retires build-docs.py). After this PR merges, the repo's Pages source needs to flip from "GitHub Actions" to "Deploy from a branch (gh-pages /)" — done out of band via the Pages API once the first gh-pages push lands.
Collaborator
Author
|
Closing — for now, in-flight previews are being rendered via adamziel/experiments (https://adamziel.github.io/experiments/php-toolkit/), which is enough for the current docs-iteration cadence. Switching the WordPress org repo's Pages source from "GitHub Actions" to a |
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
Lets us host two docs slots side by side on a single Pages site:
How it works
Concurrency group `gh-pages` is shared between both workflows so two deploys can't race for the same branch (`cancel-in-progress: false` queues rather than drops).
After merge: flip the Pages source
The repo currently has Pages source set to "GitHub Actions". Once this PR's first `docs.yml` run pushes content to the new `gh-pages` branch, the source needs to flip to "Deploy from a branch — `gh-pages` / (root)". I'll do that via the Pages API immediately after the first push lands so there's no visible downtime. Manual fallback: Settings → Pages → Source → Deploy from a branch → `gh-pages` / `/`.
Tradeoff
Test plan
🤖 Generated with Claude Code