From dadb138828708506a8c900411c920dab646fc7a4 Mon Sep 17 00:00:00 2001 From: Moritz Bogs Date: Fri, 28 Mar 2025 09:19:48 +0000 Subject: [PATCH] Prevent concurrent deployment workflows targeting same environment * Only one instance of deploy-mavis.yml can run at any time * In the rare case where deploy-application.yml or deploy-infrastructure.yml is run directly, still prevent multiple concurrent workflows of the same type --- .github/workflows/deploy-application.yml | 3 +++ .github/workflows/deploy-infrastructure.yml | 3 +++ .github/workflows/deploy-mavis.yml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/.github/workflows/deploy-application.yml b/.github/workflows/deploy-application.yml index e735fcea19..3af5693cf9 100644 --- a/.github/workflows/deploy-application.yml +++ b/.github/workflows/deploy-application.yml @@ -29,6 +29,9 @@ on: required: false type: string +concurrency: + group: deploy-application-${{ inputs.environment }} + env: aws-role: ${{ inputs.environment == 'production' && 'arn:aws:iam::820242920762:role/GithubDeployMavisAndInfrastructure' diff --git a/.github/workflows/deploy-infrastructure.yml b/.github/workflows/deploy-infrastructure.yml index 0d58d73754..fc1afcf399 100644 --- a/.github/workflows/deploy-infrastructure.yml +++ b/.github/workflows/deploy-infrastructure.yml @@ -27,6 +27,9 @@ on: required: true type: string +concurrency: + group: deploy-infrastructure-${{ inputs.environment }} + env: aws_role: ${{ inputs.environment == 'production' && 'arn:aws:iam::820242920762:role/GithubDeployMavisAndInfrastructure' diff --git a/.github/workflows/deploy-mavis.yml b/.github/workflows/deploy-mavis.yml index 73341e8c3b..aa933aaee1 100644 --- a/.github/workflows/deploy-mavis.yml +++ b/.github/workflows/deploy-mavis.yml @@ -1,6 +1,9 @@ name: Deploy Mavis on Environment run-name: Deploying Mavis on ${{ inputs.environment }} +concurrency: + group: deploy-mavis-${{ inputs.environment }} + on: workflow_call: inputs: