diff --git a/.github/workflows/deploy-hubs.yaml b/.github/workflows/deploy-hubs.yaml index a18aaa5e3f..e785072e77 100644 --- a/.github/workflows/deploy-hubs.yaml +++ b/.github/workflows/deploy-hubs.yaml @@ -45,10 +45,19 @@ on: # Exclude the template configuration files - "!config/clusters/templates" -# When multiple PRs triggering this workflow are merged, queue them instead -# of running them in parallel -# https://github.blog/changelog/2021-04-19-github-actions-limit-workflow-run-or-job-concurrency/ -concurrency: deploy +# Queue triggered executions of this workflow stemming from pushes to avoid +# deployment conflicts. +# +# By using a different concurrency groups for pull requests and pushes, we +# reduce the risk of cancelling a queued but not started workflow as discussed +# in https://github.com/2i2c-org/infrastructure/issues/3214. +# +# github.head_ref is used to create PR unique concurrency groups, and for +# workflow executions not triggered by a PR we get a dedicated group. +# +# ref: https://docs.github.com/en/actions/using-jobs/using-concurrency +# +concurrency: ${{ github.workflow }}-${{ github.head_ref || 'not-a-pr' }} # This environment variable triggers the deployer to colourise print statements in the # GitHug Actions logs for easy reading diff --git a/.github/workflows/ensure-uptime-checks.yaml b/.github/workflows/ensure-uptime-checks.yaml index 7d0e37e04a..e4c53e106c 100644 --- a/.github/workflows/ensure-uptime-checks.yaml +++ b/.github/workflows/ensure-uptime-checks.yaml @@ -14,10 +14,9 @@ on: # The way terraform is deployed might have changed! - .github/workflows/ensure-uptime-checks.yaml -# When multiple PRs triggering this workflow are merged, queue them instead -# of running them in parallel -# https://github.blog/changelog/2021-04-19-github-actions-limit-workflow-run-or-job-concurrency/ -concurrency: uptime-checks +# Queue executions of this workflow to avoid conflicts +# ref: https://docs.github.com/en/actions/using-jobs/using-concurrency +concurrency: ${{ github.workflow }} # This environment variable triggers the deployer to colourise print statements in the # GitHub Actions logs for easy reading