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