Skip to content

Deploy only on push to main, one run at a time - #2

Merged
ronnyTodgers merged 1 commit into
mainfrom
fix/deploy-workflow-triggers
Oct 11, 2026
Merged

ronnyTodgers merged 1 commit into
mainfrom
fix/deploy-workflow-triggers

Conversation

@ronnyTodgers

Copy link
Copy Markdown
Collaborator

deploy-discovery.yml ran on pull_request: closed as well as on push to main. That caused two problems:

  • Duplicate deploys. Every merged PR started two deploys at once, and they raced to force-push gh-pages. On Credit each source on study pages and stop showing CLOSER's logo #1 the push run failed with cannot lock ref 'refs/heads/gh-pages'. The PR-closed run had published the same merge commit first, so nothing broke, but it will keep producing failed runs.
  • Unmerged code going live. The trigger also fired for PRs closed without merging, and that run builds the PR's merge ref. So closing an unmerged PR would have published its code to production.

The fix:

  • Drop the pull_request trigger. Push to main already covers merges.
  • Add a concurrency group so any overlapping deploys (push, repository_dispatch, manual) queue instead of colliding.

🤖 Generated with Claude Code

The pull_request closed trigger ran a second deploy alongside the push
for every merged PR. The two raced to force-push gh-pages, and one failed.
It also ran for PRs closed without merging, which published unmerged code
to production. The push trigger already covers merges. A concurrency group
now queues deploys so they can't collide.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ronnyTodgers
ronnyTodgers merged commit bd8a904 into main Oct 11, 2026
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