Skip to content

Commit 46d843e

Browse files
author
Tulip Blossom
committed
ci: add input for pushing image
PR from @p5 applied as a patch Signed-off-by: Tulip Blossom <tulilirockz@posteo.com>
1 parent 282a7f2 commit 46d843e

6 files changed

Lines changed: 12 additions & 3 deletions

File tree

.github/workflows/build-image-beta.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
with:
2828
brand_name: ${{ matrix.brand_name }}
2929
stream_name: beta
30+
push: ${{ github.event_name != "pull_request" }}
3031

3132
generate-release:
3233
name: Generate Release

.github/workflows/build-image-gts.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
# kernel_pin: 6.14.11-200.fc41.x86_64 ## This is where kernels get pinned.
2828
brand_name: ${{ matrix.brand_name }}
2929
stream_name: gts
30+
push: ${{ github.event_name != "pull_request" }}
3031

3132
generate_release:
3233
name: Generate Release

.github/workflows/build-image-latest-hwe.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
image_flavors: '["hwe", "hwe-nvidia", "hwe-nvidia-open"]'
1919
brand_name: ${{ matrix.brand_name }}
2020
stream_name: latest
21+
push: ${{ github.event_name != "pull_request" }}
2122

2223
generate-release:
2324
name: Generate Release

.github/workflows/build-image-latest-main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
image_flavors: '["main", "nvidia", "nvidia-open"]'
2727
brand_name: ${{ matrix.brand_name }}
2828
stream_name: latest
29+
push: ${{ github.event_name != "pull_request" }}
2930

3031
generate-release:
3132
name: Generate Release

.github/workflows/build-image-stable.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
# kernel_pin: 6.14.11-300.fc42.x86_64 ## This is where kernels get pinned.
2929
brand_name: ${{ matrix.brand_name }}
3030
stream_name: stable
31+
push: ${{ github.event_name != "pull_request" }}
3132

3233
generate-release:
3334
name: Generate Release

.github/workflows/reusable-build.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ on:
1818
kernel_pin:
1919
description: "The full kernel version to pin"
2020
type: string
21+
push:
22+
description: "Whether the image should be pushed to a registry"
23+
type: string
24+
default: false
2125

2226
env:
2327
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
@@ -170,14 +174,14 @@ jobs:
170174
string: ${{ env.IMAGE_REGISTRY }}
171175

172176
- name: Login to GitHub Container Registry
173-
if: github.event_name != 'pull_request'
177+
if: inputs.push == "true"
174178
run: |
175179
echo ${{ secrets.GITHUB_TOKEN }} | podman login ghcr.io -u ${{ github.actor }} --password-stdin
176180
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
177181
178182
- name: Push to GHCR
179183
id: push
180-
if: github.event_name != 'pull_request'
184+
if: inputs.push == "true"
181185
uses: Wandalen/wretry.action@e68c23e6309f2871ca8ae4763e7629b9c258e1ea # v3.8.0
182186
with:
183187
attempt_limit: 3
@@ -219,7 +223,7 @@ jobs:
219223
COSIGN_PRIVATE_KEY: ${{ secrets.SIGNING_SECRET }}
220224

221225
- name: Sign container image
222-
if: github.event_name != 'pull_request' && contains(matrix.image_flavor, 'hwe')
226+
if: inputs.push == "true" && contains(matrix.image_flavor, 'hwe')
223227
shell: bash
224228
run: |
225229
image_name="${{ env.IMAGE_NAME }}"

0 commit comments

Comments
 (0)