Skip to content

Commit f17c37f

Browse files
authored
Merge pull request #4060 from consideRatio/pr/automation-1
automation: reduce risk of deployments getting cancelled
2 parents 38385d4 + fc555dc commit f17c37f

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

.github/workflows/deploy-hubs.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,19 @@ on:
4545
# Exclude the template configuration files
4646
- "!config/clusters/templates"
4747

48-
# When multiple PRs triggering this workflow are merged, queue them instead
49-
# of running them in parallel
50-
# https://github.blog/changelog/2021-04-19-github-actions-limit-workflow-run-or-job-concurrency/
51-
concurrency: deploy
48+
# Queue triggered executions of this workflow stemming from pushes to avoid
49+
# deployment conflicts.
50+
#
51+
# By using a different concurrency groups for pull requests and pushes, we
52+
# reduce the risk of cancelling a queued but not started workflow as discussed
53+
# in https://github.com/2i2c-org/infrastructure/issues/3214.
54+
#
55+
# github.head_ref is used to create PR unique concurrency groups, and for
56+
# workflow executions not triggered by a PR we get a dedicated group.
57+
#
58+
# ref: https://docs.github.com/en/actions/using-jobs/using-concurrency
59+
#
60+
concurrency: ${{ github.workflow }}-${{ github.head_ref || 'not-a-pr' }}
5261

5362
# This environment variable triggers the deployer to colourise print statements in the
5463
# GitHug Actions logs for easy reading

.github/workflows/ensure-uptime-checks.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ on:
1414
# The way terraform is deployed might have changed!
1515
- .github/workflows/ensure-uptime-checks.yaml
1616

17-
# When multiple PRs triggering this workflow are merged, queue them instead
18-
# of running them in parallel
19-
# https://github.blog/changelog/2021-04-19-github-actions-limit-workflow-run-or-job-concurrency/
20-
concurrency: uptime-checks
17+
# Queue executions of this workflow to avoid conflicts
18+
# ref: https://docs.github.com/en/actions/using-jobs/using-concurrency
19+
concurrency: ${{ github.workflow }}
2120

2221
# This environment variable triggers the deployer to colourise print statements in the
2322
# GitHub Actions logs for easy reading

0 commit comments

Comments
 (0)