From a3f0c210cbe9dba85b91484dc9b8d051eefa84cc Mon Sep 17 00:00:00 2001 From: Roy Kid Date: Thu, 17 Sep 2026 14:06:00 +0200 Subject: [PATCH] ci: allow manual re-run of the docs deploy The docs deploy pushes to gh-pages, a single shared ref, so two master merges landing seconds apart deploy in parallel and the slower job's `mike deploy -p` is rejected as non-fast-forward. That is what broke run 35215109985: #47 and #46 merged 36 seconds apart, #47 won the race, and #46's docs fix never reached the site while everything else in the run was green. Waiting for a PR's docs deploy to finish before merging the next one avoids the race, so this does not serialize deploys automatically. It only opens the repair path: the workflow already accepted workflow_dispatch, but deploy-docs was gated on `github.event_name == 'push'`, so a manual run rebuilt and tested without ever redeploying the docs. Accepting workflow_dispatch there makes "Run workflow" on master actually replay the deploy. --- .github/workflows/build_and_test.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 3634828d..b823e054 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -98,7 +98,12 @@ jobs: tags: ${{ vars.NEW_DOCKERHUB_REPO }}:${{ env.TAG }}-cpu deploy-docs: name: Deploy docs - if: github.repository == 'Teoroo-CMC/PiNN' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')) + # workflow_dispatch is allowed here so a deploy can be replayed by hand: + # gh-pages is a single shared ref, and two master merges landing seconds + # apart deploy in parallel, with the slower job's `mike deploy -p` rejected + # as non-fast-forward. Waiting for a PR's docs deploy before merging the + # next one avoids that; this is the repair path for when it happens anyway. + if: github.repository == 'Teoroo-CMC/PiNN' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')) needs: pytest runs-on: ubuntu-latest steps: