Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ on:
# Allow manual re-builds from the Actions tab.
workflow_dispatch:

# Only one docs deployment should run at a time to avoid race conditions on
# the gh-pages branch.
# Per-ref grouping so a new push supersedes an in-flight BUILD of the same
# ref (PR iterations, repeated pushes to main). This deliberately does NOT
# serialise deployments: a push to main and its release tag are different
# refs, so they land in different groups. The deploy job carries its own
# ref-independent group for that — see below.
concurrency:
group: docs-${{ github.ref }}
group: docs-build-${{ github.ref }}
cancel-in-progress: true

permissions:
Expand Down Expand Up @@ -91,6 +94,17 @@ jobs:
# Skip deployment for pull requests.
if: github.event_name != 'pull_request'

# Every deploy pushes to the SAME branch (gh-pages), so they must be
# serialised across refs, not per-ref. Releasing tags main and v* almost
# simultaneously, which previously raced: whichever run pushed second was
# rejected with "cannot lock ref 'refs/heads/gh-pages'" and its version
# directory never appeared, while switcher.json still advertised it.
# cancel-in-progress is false because these runs must QUEUE — cancelling
# one would drop a version directory just as surely as the race did.
concurrency:
group: docs-deploy
cancel-in-progress: false

steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
6 changes: 6 additions & 0 deletions upcoming_changes/+docs-deploy-race.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Fixed the docs deployment racing itself on release. A push to ``main`` and its
release tag are different refs, so the ``docs-${{ github.ref }}`` concurrency
group put them in separate groups and both pushed to ``gh-pages`` at once; the
loser was rejected and its versioned directory never appeared, while
``switcher.json`` still advertised the version. The deploy job now uses a
ref-independent group so deployments queue instead.
3 changes: 3 additions & 0 deletions upcoming_changes/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This file keeps the upcoming_changes/ directory tracked by git.
# Replace it with real fragment files (e.g. 42.new_feature.rst) as PRs land.

Loading