Skip to content

Commit 471f48a

Browse files
committed
add push override
1 parent 07c6806 commit 471f48a

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.github/workflows/ci-build.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,20 @@ on:
1717
required: false
1818
type: boolean
1919
default: false
20+
push:
21+
description: 'Push image to registry (makes it push if it usually wouldnt)'
22+
required: false
23+
type: boolean
24+
default: false
2025
workflow_dispatch:
2126

2227
name: ci-build
2328

2429
env:
2530
REGISTRY: ghcr.io
2631
DOTNET_VERSION: 9.0.x
32+
33+
PUSH: ${{ inputs.push || (github.ref_protected && github.event_name != 'pull_request') }}
2734

2835
jobs:
2936

@@ -84,15 +91,15 @@ jobs:
8491
uses: ./.github/actions/build-app
8592
with:
8693
dockerfile: ${{ matrix.dockerfile }}
87-
push: ${{ github.ref_protected && github.event_name != 'pull_request' }}
94+
push: ${{ env.PUSH }}
8895
image: ${{ matrix.image }}
8996
platforms: ${{ inputs.platforms || 'linux/amd64' }}
9097

9198
promote-image:
9299
name: Promote Image (${{ matrix.image }})
93100
needs: [build, tests]
94101
runs-on: ubuntu-latest
95-
if: ${{ github.ref_protected && github.event_name != 'pull_request' }}
102+
if: ${{ env.PUSH }}
96103
strategy:
97104
fail-fast: false
98105
matrix:

.github/workflows/ci-tag.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ jobs:
3333
uses: ./.github/workflows/ci-build.yml
3434
with:
3535
platforms: linux/amd64,linux/arm64
36-
latest: ${{ needs.get-latest-tag.outputs.latest-tag == github.ref_name }}
36+
latest: ${{ needs.get-latest-tag.outputs.latest-tag == github.ref_name }}
37+
push: true

0 commit comments

Comments
 (0)