Skip to content

ci(docs): build on pull requests, and serialise gh-pages deploys - #7

Merged
tannevaled merged 1 commit into
mainfrom
ci/build-docs-on-pull-request
Aug 20, 2026
Merged

tannevaled merged 1 commit into
mainfrom
ci/build-docs-on-pull-request

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

The workflow ran only on pushes to main, so a pull request touching the docs or requirements.txt got no signal at all — nothing could say whether it was safe to merge.

That is not hypothetical here: this repository has open dependency PRs whose checks read "no checks", which is not the same thing as green and must not be merged as if it were.

Two changes

  • A build job on every pull request, running mkdocs build --strict so a broken link or an unknown config key fails rather than warning into a log nobody reads.
  • deploy is now guarded by if: push || workflow_dispatch and needs: build, so a pull request stops after building and never pushes gh-pages — plus a gh-pages-deploy concurrency group with cancel-in-progress: false, because two concurrent mike deploy --push runs end in ! [rejected] gh-pages -> gh-pages (fetch first), and killing a publish half way through is worse than making it wait.

The build job reuses the python version and action pins already in this file rather than fresh ones, so it neither contradicts the deploy job nor opens a new Renovate PR.

Verified before being applied, not after

mkdocs build --strict was run locally against this site and against all 168 ungated docs repos in the fleet. All 168 passed — which is why this lands green rather than red.

That order matters: the build job runs on pushes to main too, so gating a site that does not build strictly would turn its main branch red.

🤖 Generated with Claude Code

The workflow ran only on pushes to main, so a pull request touching the
docs or requirements.txt got no signal at all -- nothing could say whether
it was safe to merge. That is not hypothetical here: this repository has
open dependency PRs whose checks read "no checks", which is not the same
thing as green and must not be merged as if it were.

Two changes:

  - a build job on every pull request, running `mkdocs build --strict` so a
    broken link or an unknown config key fails rather than warning into a
    log nobody reads;

  - deploy is now guarded by `if: push || workflow_dispatch` and `needs:
    build`, so a pull request stops after building and never pushes
    gh-pages, plus a `gh-pages-deploy` concurrency group with
    cancel-in-progress FALSE, because two concurrent `mike deploy --push`
    runs end in `! [rejected] gh-pages -> gh-pages (fetch first)` and
    killing a publish half way through is worse than making it wait.

The build job reuses the python version and action pins already in this
file rather than fresh ones, so it neither contradicts the deploy job nor
opens a new Renovate PR.

Verified before being applied: `mkdocs build --strict` was run locally
against this site, and against all 168 ungated docs repos in the fleet.
All 168 passed, which is why this lands green rather than red.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 98a7502 into main Aug 20, 2026
2 checks passed
@tannevaled
tannevaled deleted the ci/build-docs-on-pull-request branch August 20, 2026 13:22
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