Commit c5c0f9f
ci(docs): serialize gh-pages deploys to fix the "cannot lock ref" race (DOI-USGS#339)
Two commits landing on main within a couple of minutes spawn two "Sphinx
Docs Build" runs that both force-push gh-pages via
JamesIves/github-pages-deploy-action. The newer run reads the gh-pages tip,
the older run advances it first, and the newer run's push is then rejected:
! [remote rejected] ... -> gh-pages
(cannot lock ref 'refs/heads/gh-pages': is at <new> but expected <old>)
The Sphinx build itself succeeds; only the concurrent deploy loses the race.
Add a workflow-level concurrency group keyed on the ref so runs targeting the
same branch serialize instead of racing. cancel-in-progress is false so every
commit's docs still deploy (the later run simply queues behind the earlier one
and force-pushes on top). PR builds, which key on their own ref and don't
deploy, are unaffected.
Claude-Session: https://claude.ai/code/session_01Sjb14HkwuCydKSKMsaXsgd
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 20b6eba commit c5c0f9f
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
9 | 18 | | |
10 | 19 | | |
11 | 20 | | |
| |||
0 commit comments