Repository navigation
ci: deploy the API reference from the release, after the publish job - #8
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 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
HEADhas 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.
| - 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 |
Contributor
Author
There was a problem hiding this comment.
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.
Deploying tetrak with
|
| 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 |
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
force-pushed
the
ci/deploy-api-docs-only-from-tags
branch
from
October 8, 2026 13:28
6dd37aa to
983b5dd
Compare
4 tasks done
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
main. A merge that cuts no release lands an untagged commit, which hatch-vcs honestly versions asX.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.git describe --exact-matchgate that prevented this was removed with theworkflow_runtrigger 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 oldproduct/**path filter hid how often that happened.release.ymlgains adocsjob that needspublishand callssphinx-docs.ymlwith the tag. The build checks out the tag and asserts the installed package reports it before deploying.gh workflow run sphinx-docs.yml --ref main -f tag=5.14.1. Thegithub-pagesenvironment admits deployments frommainonly, so a dispatch against the tag ref builds correctly and is then refused (verified when the first redeploy was attempted).Test plan
actionlintpasses on both workflowsapi-docs-buildcheck builds without uploading or deployingmainbuilds and the deploy job is skippedmainwithtag=5.14.1republishes tetrak 5.14.1 documentationdocsjob afterpublishand the page shows that version🤖 Generated with Claude Code