Skip to content

Commit 0078d11

Browse files
sjmonsonmarkurtz
authored andcommitted
Add container build jobs to all build workflows (#190)
Add container build jobs alongside the existing wheel jobs. Tag containers based on which workflow was triggered. Tags: * PR: `pr-{{ github.event.number }}` ~`{{ github.sha }}`~ * Nightly: `nightly` ~`{{ github.sha }}`~ * Release candidate: `latest` ~`{{ github.sha }}`~ * Release: `latest` `stable` ~`{{ github.sha }}`~ Edit: To save space, don't use unique tags. - - - * Tag RC and releases with their versions. (e.g. 0.3.0-rc, 0.3.0) * Reuse wheel builds in container --------- Co-authored-by: Mark Kurtz <[email protected]>
1 parent 085f4d9 commit 0078d11

File tree

4 files changed

+99
-0
lines changed

4 files changed

+99
-0
lines changed

.github/workflows/development.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,3 +353,28 @@ jobs:
353353
- name: Skip build notification
354354
if: steps.check-changes.outputs.should_build == 'false'
355355
run: echo "Skipping UI preview build - no relevant files changed"
356+
357+
build-and-push-container:
358+
runs-on: ubuntu-latest
359+
permissions:
360+
packages: write
361+
steps:
362+
- name: Checkout
363+
uses: actions/checkout@v4
364+
- name: Buildah build
365+
id: build-image
366+
uses: redhat-actions/buildah-build@v2
367+
with:
368+
image: ${{ github.event.repository.name }}
369+
tags: "pr-${{ github.event.number }}"
370+
containerfiles: |
371+
./deploy/Containerfile
372+
- name: Push To ghcr.io
373+
id: push-to-ghcr
374+
uses: redhat-actions/push-to-registry@v2
375+
with:
376+
image: ${{ steps.build-image.outputs.image }}
377+
tags: ${{ steps.build-image.outputs.tags }}
378+
username: ${{ github.actor }}
379+
password: ${{ github.token }}
380+
registry: ghcr.io/${{ github.repository_owner }}

.github/workflows/nightly.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,27 @@ jobs:
244244
user_name: ${{ github.actor }}
245245
user_email: ${{ github.actor }}@users.noreply.github.com
246246
publish_branch: gh-pages
247+
248+
build-and-push-container:
249+
needs: [unit-tests, integration-tests, e2e-tests]
250+
runs-on: ubuntu-latest
251+
steps:
252+
- name: Checkout
253+
uses: actions/checkout@v4
254+
- name: Buildah build
255+
id: build-image
256+
uses: redhat-actions/buildah-build@v2
257+
with:
258+
image: ${{ github.event.repository.name }}
259+
tags: nightly
260+
containerfiles: |
261+
./deploy/Containerfile
262+
- name: Push To ghcr.io
263+
id: push-to-ghcr
264+
uses: redhat-actions/push-to-registry@v2
265+
with:
266+
image: ${{ steps.build-image.outputs.image }}
267+
tags: ${{ steps.build-image.outputs.tags }}
268+
username: ${{ github.actor }}
269+
password: ${{ github.token }}
270+
registry: ghcr.io/${{ github.repository_owner }}

.github/workflows/release-candidate.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,3 +288,28 @@ jobs:
288288
user_name: ${{ github.actor }}
289289
user_email: ${{ github.actor }}@users.noreply.github.com
290290
publish_branch: gh-pages
291+
292+
build-and-push-container:
293+
needs: [unit-tests, integration-tests, e2e-tests]
294+
runs-on: ubuntu-latest
295+
steps:
296+
- name: Checkout
297+
uses: actions/checkout@v4
298+
- name: Buildah build
299+
id: build-image
300+
uses: redhat-actions/buildah-build@v2
301+
with:
302+
image: ${{ github.event.repository.name }}
303+
# TODO: Tag version
304+
tags: latest
305+
containerfiles: |
306+
./deploy/Containerfile
307+
- name: Push To ghcr.io
308+
id: push-to-ghcr
309+
uses: redhat-actions/push-to-registry@v2
310+
with:
311+
image: ${{ steps.build-image.outputs.image }}
312+
tags: ${{ steps.build-image.outputs.tags }}
313+
username: ${{ github.actor }}
314+
password: ${{ github.token }}
315+
registry: ghcr.io/${{ github.repository_owner }}

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,3 +287,28 @@ jobs:
287287
user_name: ${{ github.actor }}
288288
user_email: ${{ github.actor }}@users.noreply.github.com
289289
publish_branch: gh-pages
290+
291+
build-and-push-container:
292+
needs: [unit-tests, integration-tests, e2e-tests]
293+
runs-on: ubuntu-latest
294+
steps:
295+
- name: Checkout
296+
uses: actions/checkout@v4
297+
- name: Buildah build
298+
id: build-image
299+
uses: redhat-actions/buildah-build@v2
300+
with:
301+
image: ${{ github.event.repository.name }}
302+
# TODO: Tag version
303+
tags: latest stable
304+
containerfiles: |
305+
./deploy/Containerfile
306+
- name: Push To ghcr.io
307+
id: push-to-ghcr
308+
uses: redhat-actions/push-to-registry@v2
309+
with:
310+
image: ${{ steps.build-image.outputs.image }}
311+
tags: ${{ steps.build-image.outputs.tags }}
312+
username: ${{ github.actor }}
313+
password: ${{ github.token }}
314+
registry: ghcr.io/${{ github.repository_owner }}

0 commit comments

Comments
 (0)