Skip to content

Commit

Permalink
Don't allow concurrent runs of scheduled + interactive workflows
Browse files Browse the repository at this point in the history
... deploying to same URL
  • Loading branch information
rhaschke committed Feb 17, 2025
1 parent 66aaf2d commit 191fab0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:
DEBS_PATH: ${{ vars.DEBS_PATH || '~/debs' }}
TERM: xterm # needed for colored output of unittests

# New workflow run replaces previous one
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ env:

concurrency:
# Ensure exclusive access to deployment target
group: ${{ inputs.DEPLOY_URL || vars.DEPLOY_URL }}
group: deploy-to-${{ inputs.DEPLOY_URL || vars.DEPLOY_URL }}
cancel-in-progress: false

jobs:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/interactive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ on:
description: Incrementally fill chroot?
required: false

# Don't allow concurrent runs of workflows deploying to same target
concurrency:
group: build-and-deploy-to-${{ vars.DEPLOY_URL }}
cancel-in-progress: false

jobs:
stage-1:
uses: ./.github/workflows/build.yaml
Expand Down Expand Up @@ -137,10 +142,6 @@ jobs:
if: success() && vars.DEPLOY_URL
timeout-minutes: 15
runs-on: ubuntu-latest
concurrency:
# Ensure exclusive access to deployment target
group: ${{ vars.DEPLOY_URL }}
cancel-in-progress: false
steps:
- uses: actions/checkout@v4
- name: Import build artifacts to reprepro server
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/scheduled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
- cron: "0 20 * * *"


# Don't allow concurrent runs of workflows deploying to same target
concurrency:
group: build-and-deploy-to-${{ vars.DEPLOY_URL }}
cancel-in-progress: false

jobs:
build:
strategy:
Expand Down Expand Up @@ -37,10 +42,6 @@ jobs:
if: always() && vars.DEPLOY_URL
timeout-minutes: 15
runs-on: ubuntu-latest
concurrency:
# Ensure exclusive access to deployment target
group: ${{ vars.DEPLOY_URL }}
cancel-in-progress: false
steps:
- uses: actions/checkout@v4
- name: Import build artifacts to reprepro server
Expand Down

0 comments on commit 191fab0

Please sign in to comment.