How to Queue Deploys Without Canceling in GitHub Actions
Setting cancel-in-progress: false makes a new run wait for the current one to finish instead of interrupting it.
For deploys you rarely want to cancel a release mid-flight. A shared concurrency group with cancel-in-progress: false queues the next run behind the running one so only one deploy proceeds at a time.
Steps
- Give the deploy job (or workflow) a stable
concurrency.group. - Set
cancel-in-progress: falseso a running deploy is never interrupted. - Newer queued runs wait; only the most recent pending one is kept.
Workflow
.github/workflows/deploy.yml
on:
push:
branches: [main]
concurrency:
group: deploy-production
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v4
- run: ./deploy.shGotchas
- Only one pending run is queued per group; a third push cancels the earlier pending one, not the running one.
- Latchkey managed runners cut the queue time on serialized deploys and auto-retry transient failures.
Related guides
How to Serialize Production Deploys in GitHub ActionsSerialize production deploys in GitHub Actions with a single static concurrency group so two release runs can…
How to Queue Release Jobs So They Never Overlap in GitHub ActionsQueue GitHub Actions release jobs so two publishes never overlap by sharing one concurrency group across tag…