From 8ae5ab73e361a25e11c2997d7e47443ef055a23a Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Fri, 19 Jun 2026 19:11:43 +0200 Subject: [PATCH] ci: fix pipeline concurrency and target evaluation bugs 1. Added native Gitea/GitHub Actions concurrency group to automatically cancel outdated/stale deploy runs for the same branch (fixes 'alte deploys durchjagen'). 2. Replaced the buggy 'github.ref_type' condition with explicit 'github.ref' matching. Gitea often failed to populate ref_type, causing staging tags to be downgraded to 'branch' target, making them equal priority to feature branches where the newer run would win (fixes 'feature branches wichtiger als staging'). --- .gitea/workflows/deploy.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 9a0fbe9a7..b92716cc5 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -13,6 +13,10 @@ on: required: false default: 'false' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + env: PUPPETEER_SKIP_DOWNLOAD: "true" COREPACK_NPM_REGISTRY: "https://registry.npmmirror.com" @@ -89,12 +93,12 @@ jobs: DOMAIN="e-tib.com" PRJ="etib" - if [[ "${{ github.ref_type }}" == "branch" && "$REF" == "main" ]]; then + if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then TARGET="testing" IMAGE_TAG="main-${SHORT_SHA}" ENV_FILE=".env.testing" TRAEFIK_HOST="test.${DOMAIN}" - elif [[ "${{ github.ref_type }}" == "tag" ]]; then + elif [[ "${{ github.ref }}" == refs/tags/* ]]; then if [[ "$REF" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then TARGET="production" IMAGE_TAG="$REF"