Skip to content

Commit

Permalink
ci: use a single, non-cancelled concurrency group for main branch & tags
Browse files Browse the repository at this point in the history
  • Loading branch information
basti1302 committed Nov 18, 2024
1 parent 938be5a commit 0da54da
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,17 @@ on:
workflow_dispatch:

concurrency:
group: ci-concurrency-group-${{ github.ref }}
cancel-in-progress: true
# Branches and PR all run in their individual, separate concurrency groups (with cancel-in-progress: true). The main
# branch and tags (which are used for releases) run in one shared concurrency group (with cancel-in-progress: true).
# This allows to schedule a release immediately after merging a PR to main, and have the release's CI build be queued
# automatically after the CI build for main has finished. That way, the CI build for the release will be able to reuse
# the Docker cache from the CI build for main.
group: ci-concurrency-group-${{ (github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/')) && 'main-and-tags' || github.ref }}
# For branches and PRs, we cancel existing builds if a new commit comes in. For the main branch and tags, we queue
# them and let the run one after the other. The reason is that we build multi-arch container images on main and for
# tags, which takes a really long time if there are changes. But once they have been build, Docker caching makes the
# next builds fast again.
cancel-in-progress: ${{ !(github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/')) }}

jobs:
verify:
Expand Down

0 comments on commit 0da54da

Please sign in to comment.