From 8ce58779f2899879e5df96e47acb838e38f026db Mon Sep 17 00:00:00 2001 From: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> Date: Wed, 23 Sep 2026 05:08:47 -0400 Subject: [PATCH] fix(ci): deploy Pages once per release instead of twice Every release-worthy push started two Pages deploys: the push itself, then release.yml's dispatch after the version bump, which cancelled the first (8 of the last 9 push runs were cancelled). A gate job now applies release.yml's own commit-subject test to the pushed commits and skips the push deploy when a release will dispatch one. Non-release pushes (docs, chore) and manual dispatches deploy as before. Also adds pages.yml to its own trigger paths, so a change to the deploy workflow deploys. Closes #215 Co-Authored-By: Claude Opus 5.5 (1M context) Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> --- .github/workflows/pages.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 089f6e77..6c75cc6f 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -22,6 +22,7 @@ on: - "scripts/build_gallery.py" - "scripts/site/**" - "CHANGELOG.md" + - ".github/workflows/pages.yml" workflow_dispatch: permissions: @@ -33,7 +34,34 @@ concurrency: cancel-in-progress: true jobs: + # A push that will cut a release gets its deploy from release.yml, which dispatches + # this workflow after committing the version bump. Deploying on the push too only + # built a page that the dispatch then cancelled (8 of 9 push runs measured, #215). + # The pattern mirrors release.yml's "Determine bump type" step exactly. If that + # release fails, redeploy by hand: Actions > Deploy GitHub Pages > Run workflow. + gate: + runs-on: ubuntu-latest + outputs: + deploy: ${{ steps.decide.outputs.deploy }} + steps: + - id: decide + env: + EVENT: ${{ github.event_name }} + COMMITS: ${{ toJSON(github.event.commits) }} + run: | + deploy=true + if [ "$EVENT" = "push" ] && echo "$COMMITS" \ + | jq -r '.[].message | split("\n")[0]' \ + | grep -qiE '^(feat|feature|fix)(\(.+\))?!?:|BREAKING[ -]CHANGE'; then + deploy=false + echo "Release-worthy push: release.yml dispatches Pages after the version bump." + fi + echo "deploy=$deploy" >> "$GITHUB_OUTPUT" + echo "deploy=$deploy" + build-and-deploy: + needs: gate + if: needs.gate.outputs.deploy == 'true' environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }}