diff --git a/.github/workflows/backend-production-deploy.yml b/.github/workflows/backend-production-deploy.yml index fea539ff0..e54d99fd4 100644 --- a/.github/workflows/backend-production-deploy.yml +++ b/.github/workflows/backend-production-deploy.yml @@ -4,6 +4,13 @@ on: release: types: [released] +concurrency: + # If this workflow is already running, cancel it to avoid a scenario + # where the older run finishes *after* the newer run and overwrites + # the deployment with an older version of the app. + group: ${{ github.workflow }} + cancel-in-progress: true + jobs: reset-release-branch: name: Update release branch diff --git a/.github/workflows/backend-staging-deploy.yml b/.github/workflows/backend-staging-deploy.yml index a17d651d7..7efe35d8d 100644 --- a/.github/workflows/backend-staging-deploy.yml +++ b/.github/workflows/backend-staging-deploy.yml @@ -7,6 +7,13 @@ on: paths-ignore: - "web/**" +concurrency: + # If this workflow is already running, cancel it to avoid a scenario + # where the older run finishes *after* the newer run and overwrites + # the deployment with an older version of the app. + group: ${{ github.workflow }} + cancel-in-progress: true + jobs: deploy: name: Deploy to Heroku