From 0c7b96e887eb17b6a7eb3988141aa42ecb756867 Mon Sep 17 00:00:00 2001 From: Michael Schiemer Date: Sat, 1 Nov 2025 21:21:58 +0100 Subject: [PATCH] fix(ci): Fix workflow job dependencies and execution flow - Removed runtime-base from build job dependencies (build now only depends on changes) - runtime-base now only runs when needed (if needs_runtime_build or needs_build is true) - build job now handles missing runtime-base outputs gracefully - deploy-staging and deploy-production now only depend on build (not runtime-base) - Added always() conditions to ensure jobs run even if previous jobs are skipped - Fixes issue where workflow stopped after runtime-base job when build was skipped --- .gitea/workflows/build-image.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/build-image.yml b/.gitea/workflows/build-image.yml index 934a66ba..ac9f341a 100644 --- a/.gitea/workflows/build-image.yml +++ b/.gitea/workflows/build-image.yml @@ -187,6 +187,7 @@ jobs: runtime-base: name: Build Runtime Base Image needs: changes + if: always() runs-on: docker-build outputs: image_ref: ${{ steps.set-result.outputs.image_ref }} @@ -470,7 +471,7 @@ jobs: # Job 2: Build & Push Docker Image build: name: Build Docker Image - needs: [changes, runtime-base] + needs: [changes] if: needs.changes.outputs.needs_build == 'true' runs-on: docker-build outputs: @@ -647,8 +648,9 @@ jobs: DEFAULT_IMAGE="${{ env.REGISTRY }}/${{ env.RUNTIME_IMAGE_NAME }}:latest" SELECTED_IMAGE="$DEFAULT_IMAGE" - if [ -n "${{ needs.runtime-base.outputs.image_ref }}" ]; then - SELECTED_IMAGE="${{ needs.runtime-base.outputs.image_ref }}" + RUNTIME_BASE_REF="${{ needs.runtime-base.outputs.image_ref || '' }}" + if [ -n "$RUNTIME_BASE_REF" ] && [ "$RUNTIME_BASE_REF" != "" ]; then + SELECTED_IMAGE="$RUNTIME_BASE_REF" else if ! docker pull "$DEFAULT_IMAGE" >/dev/null 2>&1; then ALT_REGISTRY="${{ env.REGISTRY_URL }}" @@ -929,8 +931,8 @@ jobs: # Job 4: Auto-deploy to Production (only for main branch) deploy-production: name: Auto-deploy to Production - needs: [changes, build, runtime-base] - if: (github.ref_name == 'main' || github.head_ref == 'main' || (github.ref_name == '' && contains(github.ref, 'main'))) && needs.changes.outputs.needs_build == 'true' + needs: [changes, build] + if: always() && (github.ref_name == 'main' || github.head_ref == 'main' || (github.ref_name == '' && contains(github.ref, 'main'))) && needs.changes.outputs.needs_build == 'true' runs-on: ubuntu-latest environment: name: production