Skip to content

ci: deploy the API reference from the release, after the publish job - #8

Merged
stephen-masters merged 1 commit into
mainfrom
ci/deploy-api-docs-only-from-tags
Oct 8, 2026
Merged

stephen-masters merged 1 commit into
mainfrom
ci/deploy-api-docs-only-from-tags

Conversation

@stephen-masters

@stephen-masters stephen-masters commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The Sphinx API reference at scattercode.github.io/tetrak deployed on every push to main. A merge that cuts no release lands an untagged commit, which hatch-vcs honestly versions as X.Y.Z.devN, so the chore merge of chore: stop ignoring cntx's workspace folder #6 left the page reading tetrak 5.14.2.dev2 documentation two days after 5.14.1 had published cleanly.
  • The git describe --exact-match gate that prevented this was removed with the workflow_run trigger in the pre-split repository (feat(ocr): decide with sillybos before any decoder opens a scan #88). The release push does land on the tagged commit, but the branch push also fires for non-release merges, and the old product/** path filter hid how often that happened.
  • Restoring that gate was the first version of this PR. Copilot's review pointed out it was not enough: Release pushes the tag before the build and publish jobs, so a deploy from that push could run while publication was pending and leave the reference ahead of PyPI if it failed.
  • Now the push and PR paths build and stop. release.yml gains a docs job that needs publish and calls sphinx-docs.yml with the tag. The build checks out the tag and asserts the installed package reports it before deploying.
  • A hand redeploy is gh workflow run sphinx-docs.yml --ref main -f tag=5.14.1. The github-pages environment admits deployments from main only, so a dispatch against the tag ref builds correctly and is then refused (verified when the first redeploy was attempted).
  • CLAUDE.md documents the rule and the redeploy.

Test plan

  • actionlint passes on both workflows
  • This PR's api-docs-build check builds without uploading or deploying
  • After merge, the push to main builds and the deploy job is skipped
  • A dispatch from main with tag=5.14.1 republishes tetrak 5.14.1 documentation
  • The next real release runs the docs job after publish and the page shows that version

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings October 8, 2026 11:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A release tag can trigger deployment before the corresponding PyPI publication succeeds.

1 open finding
What changed in this PR

Gates Sphinx API-reference deployments to tagged commits while retaining unconditional validation builds.

Changes:

  • Detects whether HEAD has a release tag.
  • Restricts artifact upload and deployment to tagged runs.
  • Documents release-only deployment and manual redeployment.
File Description
.github/​workflows/​sphinx-docs.yml Adds the tag-based deployment gate.
CLAUDE.md Documents the deployment policy.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread .github/workflows/sphinx-docs.yml Outdated
- name: Check whether this build lands on a release tag
id: release_check
run: |
if git describe --exact-match --tags HEAD >/dev/null 2>&1; then

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, and reworked. The deploy is now a docs job in release.yml that needs publish and calls this workflow with the tag; the push and pull_request paths build and stop. The build also asserts the installed package reports the requested tag before anything is uploaded.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Deploying tetrak with  Cloudflare Pages  Cloudflare Pages

Latest commit: 983b5dd
Status: ✅  Deploy successful!
Preview URL: https://edfe9d98.tetrak.pages.dev
Branch Preview URL: https://ci-deploy-api-docs-only-from.tetrak.pages.dev

View logs

The Sphinx docs deployed on every push to main, and hatch-vcs versions
a build from an untagged commit as X.Y.Z.devN. A merge that cuts no
release therefore published a dev title with nothing due to overwrite
it: the chore merge of #6 left scattercode.github.io/tetrak reading
"tetrak 5.14.2.dev2 documentation" two days after 5.14.1 had published
cleanly.

The `git describe --exact-match` gate that used to prevent this went
with the workflow_run trigger in the pre-split repository (#88), on the
reasoning that the release push now lands on the tagged commit. It
does, but the branch push also fires for non-release merges, and the
old repository's product/** path filter hid how often that happened.

Restoring that gate was the first version of this change, and review
found it short: Release pushes its tag before it builds and publishes
the wheel, so a deploy triggered by that push can run while publication
is pending and leaves the reference ahead of PyPI if publication fails.

So the push and pull_request paths now build and stop, and the deploy
is a job in release.yml that needs `publish` and calls the Sphinx
workflow with the tag. The build checks out that tag and asserts the
installed package reports it. A hand redeploy is a dispatch from main
with the tag as an input: the github-pages environment admits
deployments from main only, so a dispatch against the tag ref builds
correctly and is then refused, which is how the first redeploy went.

Co-authored-by: Yvette Mankerian <yvettekm@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@stephen-masters
stephen-masters force-pushed the ci/deploy-api-docs-only-from-tags branch from 6dd37aa to 983b5dd Compare October 8, 2026 13:28
@stephen-masters stephen-masters changed the title ci: deploy the API reference only from a tagged commit ci: deploy the API reference from the release, after the publish job Oct 8, 2026
@stephen-masters
stephen-masters merged commit 25e5f33 into main Oct 8, 2026
9 checks passed
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