Skip to content
Discussion options

You must be logged in to vote

Oh man, the classic deployment race condition. I had this exact nightmare burn down a production release before we fixed it.

The good news is you don’t need to write any complex scripts to fix this. GitHub actually added a built-in feature specifically for this scenario called concurrency.

You can group your workflow runs together and tell GitHub to automatically cancel any older, in-progress runs the second a new push comes in.

The Fix
All you need to do is add a concurrency block right at the top of your workflow YAML file (below your on: triggers).

Here is exactly how to set it up:

name: Deploy Frontend

on:
push:
branches:
- main

This is the magic snippet right here 👇
concurrency:
gro…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by genetbeneberu825-png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug GitHub or a GitHub feature is not working as intended Actions Build, test, and automate your deployment pipeline with world-class CI/CD ARC (Actions Runner Controller) For issues and discussions related to the Actions Runner Controller project Welcome 🎉 Used to greet and highlight first-time discussion participants. Welcome to the community! source:ui Discussions created via Community GitHub templates
2 participants