Skip to content

Publish the site from a gh-pages branch - #2

Merged
embarquech merged 1 commit into
mainfrom
ci/publish-from-gh-pages-branch
Sep 15, 2026
Merged

embarquech merged 1 commit into
mainfrom
ci/publish-from-gh-pages-branch

Conversation

@mmlado

@mmlado mmlado commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Publishes the site from a gh-pages branch, the way cryptnox-cli, cryptnox-sdk-py and cryptnox-id-cli do, so the generated HTML and PDF stay out of main.

Why now: Pages on this repository is set to serve the main branch. With the previous workflow, every push to main ran GitHub's own Jekyll build of the repository root and the Actions deployment, and whichever finished last was served. The first deploy happened to end with the Sphinx site on top; a later push could just as easily have left the rendered README there instead.

What changes:

  • The build job follows cryptnox-cli's docs.yml: Sphinx HTML with -W, the PDF built with pdflatex and copied next to it, then peaceiris/actions-gh-pages@v4 pushes docs/_build/html to gh-pages (with .nojekyll). Pull request builds still run the full build as a check and publish nothing.
  • A final step points the Pages source at the gh-pages branch using the workflow token (pages: write). It is a no-op once the source is right. If the token is not allowed to change it, the step fails with the instruction: an administrator sets Settings > Pages > Source to Deploy from a branch, branch gh-pages, folder / (root).

After merging, check the first run on main. If the last step is green, the site is served from gh-pages and nothing else is needed. If it is red, apply the one-time setting above straight away: until then the site shows the rendered README instead of the documentation. The gh-pages branch will already exist with the full site by that point.

🤖 Generated with Claude Code

Push the built HTML and PDF to a gh-pages branch with
peaceiris/actions-gh-pages, the way the other Cryptnox documentation
repositories do, so the generated site stays out of the source branch.

Pages on this repository is set to serve the main branch, which made
every push race GitHub's own Jekyll build against the Actions
deployment: whichever finished last was served. The workflow now points
the Pages source at gh-pages after publishing, and fails with an
instruction for an administrator if its token is not allowed to.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@mmlado
mmlado requested a review from embarquech September 14, 2026 15:26
@embarquech
embarquech merged commit 834d599 into main Sep 15, 2026
1 check passed

This branch had an error being deployed

1 failed deployment
github-pages — 65a60a47 Deployed Sep 15, 2026 by embarquech via deploy #4
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.

2 participants