Skip to content

Publish the documentation from a stable branch - #7057

Merged
gustavosbarreto merged 2 commits into
masterfrom
docs/publish-from-stable-branch
Sep 8, 2026
Merged

Publish the documentation from a stable branch#7057
gustavosbarreto merged 2 commits into
masterfrom
docs/publish-from-stable-branch

Conversation

@gustavosbarreto

@gustavosbarreto gustavosbarreto commented Sep 8, 2026

Copy link
Copy Markdown
Member

The documentation site is published continuously from master. A page written for
a feature that has not shipped yet becomes visible the moment it is merged, so
writing documentation alongside the feature means publishing it early.

This splits the site in two. The docs/stable branch becomes the production
branch of the Cloudflare Pages project and is the only one that publishes to the
site; it is moved to the release tag when a version is cut. Master and open pull
requests land on preview URLs, so documentation can be merged together with the
feature it describes without reaching readers.

A build that does not come from docs/stable carries a banner saying it is
built from master and may describe features that are not in any release yet,
linking to the documentation for the released version.

robots.txt is left alone: it still disallows everything, which is correct
while the site is served from docsv2. When it takes over the published address,
that file becomes the knob that lets the stable build be indexed and keeps the
builds from master out.

Manual steps

Merging this is not enough. After it lands, in this order:

  1. Create the branch from the tag of the current release and push it:

    git branch docs/stable "$(git describe --tags --abbrev=0 origin/master)"
    git push origin docs/stable
    
  2. Wait for Docs CD to finish publishing that branch.

  3. In the Cloudflare Pages project shellhub-docs, change the production branch
    to docs/stable.

  4. Run Docs CD on master again, from the Actions tab. Until master stops being
    the production branch it publishes to the root of the project and has no
    branch alias, so this run is what creates
    master.shellhub-docs.pages.dev and puts the unreleased documentation there.

Doing 3 before 1 leaves the project without a production branch.

Cutting a release

Moving the published documentation to a new version is one command:

git branch -f docs/stable <tag> && git push -f origin docs/stable

A fix to the published documentation has to land on master first and be
cherry-picked to docs/stable. A commit that exists only on docs/stable is
discarded by the next release.

@gustavosbarreto
gustavosbarreto requested review from a team as code owners September 8, 2026 13:23
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Claude finished @gustavosbarreto's task in 1m 22s —— View job


Code Review Complete

Reviewed 5 files across code quality, security, testing, language patterns, and architecture — no new issues found. The code looks good as-is.

The channel logic is consistent end to end: github.ref_name == 'docs/stable' in the build env (docs-cd.yml:57) drives PUBLIC_DOCS_CHANNEL, which the banner gates on (UnreleasedBanner.astro:6), and the deploy --branch (docs-cd.yml:71) routes only docs/stable to the production branch while master and PRs land on previews. Dropping the push path filter is correctly justified by the force-push release model, and the interim docsv2.shellhub.io link is an explicitly documented choice.


To request another review round, comment /review.
· docs/publish-from-stable-branch

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Documentation preview: https://0446152d.shellhub-docs.pages.dev

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Documentation preview: https://9c8504d0.shellhub-docs.pages.dev

@gustavosbarreto
gustavosbarreto force-pushed the docs/publish-from-stable-branch branch from e14c771 to fca0b77 Compare September 8, 2026 13:41
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Documentation preview: https://bd34b899.shellhub-docs.pages.dev

The site is published continuously from master, so a page describing a
feature that has not shipped in any release is visible to readers who
run the released version.

Add a banner, shown on every page unless the build declares itself as
stable through PUBLIC_DOCS_CHANNEL, saying where the build comes from
and linking to the documentation for the released version.
Only docs/stable publishes to the site; master and open pull requests
land on preview URLs, which lets documentation for an unreleased
feature be merged without reaching readers.

Drop the path filter from the push trigger. docs/stable is moved to the
release tag with a force-push, which carries no dependable list of
changed files, so a filtered trigger would skip the release.
@gustavosbarreto
gustavosbarreto force-pushed the docs/publish-from-stable-branch branch from fca0b77 to 7dec13a Compare September 8, 2026 18:40
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Documentation preview: https://185eea78.shellhub-docs.pages.dev

@gustavosbarreto
gustavosbarreto merged commit 6ebeec1 into master Sep 8, 2026
67 of 73 checks passed
@gustavosbarreto
gustavosbarreto deleted the docs/publish-from-stable-branch branch September 8, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant