Skip to content

Let the production deploy be dispatched by hand - #68

Merged
davidtaing merged 1 commit into
mainfrom
chore/deploy-workflow-dispatch
Aug 15, 2026
Merged

Let the production deploy be dispatched by hand#68
davidtaing merged 1 commit into
mainfrom
chore/deploy-workflow-dispatch

Conversation

@davidtaing

Copy link
Copy Markdown
Collaborator

The deploy workflow fires on a push to main and nothing else. That is the right default and stays the default — shipping should normally be a consequence of landing on main rather than a button someone remembers to press.

It leaves one gap, and we hit it today. A workflow disabled by hand creates no run for a push that arrives while it is off — not a queued run, not a skipped one, nothing at all. So when Vercel Deploy was re-enabled after #63#66 merged as a stack, there was no run to re-run and main sat ahead of production with no way to reconcile the two except pushing a commit whose only purpose was to be pushed.

Re-running the most recent deploy run is not a substitute and is worse than doing nothing: it redeploys the commit that run was for, which here is 497cde4 from 13 August.

The ref guard

workflow_dispatch runs against whichever ref the caller picks in the dropdown, and every step in this job passes --prod. Without a guard, selecting any branch there ships that branch to production. if: github.ref == 'refs/heads/main' sits on the job rather than inside the deploy step, so a wrong ref costs a skipped run rather than a half-finished one.

Verification

Parsed with yaml.safe_load: triggers are push and workflow_dispatch, and the job carries the ref condition. The workflow itself is unchanged below that — same pinned action SHAs, same concurrency group, same steps.

Note that merging this will itself trigger a production deploy of main, since it is a push to main and the workflow is enabled again. That is the intended outcome as well as the fix.

The workflow fires on a push to `main` and nothing else, which is the right default and stays the default. It leaves one gap, and we hit it: a workflow disabled by hand creates no run for a push that arrives while it is off — not a queued one, not a skipped one, nothing. Re-enabling it afterwards finds no run to re-run, so `main` sits ahead of production with no way to reconcile them except pushing a commit whose only purpose is to be pushed. That is what happened on 15 August 2026 when #63 through #66 landed as a stack.

`workflow_dispatch` closes it. Re-running an older run is not the same thing and is worse than doing nothing, because it redeploys the commit that run was for.

The dispatch is guarded by a ref check on the job. `push` can only fire on `main`, but a dispatch runs against whichever ref the caller picks in the dropdown, and every step in this job passes `--prod` — so without the guard, picking any branch there ships it to production. The check sits on the job rather than inside the deploy step so that a wrong ref costs a skipped run rather than a partial one.
@davidtaing
davidtaing marked this pull request as ready for review August 15, 2026 09:34
@davidtaing
davidtaing merged commit 1731b74 into main Aug 15, 2026
2 checks passed
@davidtaing
davidtaing deleted the chore/deploy-workflow-dispatch branch August 15, 2026 09:34
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