Skip to content

Commit

Permalink
Build derivative images after base images
Browse files Browse the repository at this point in the history
This will let e.g. arch, ubuntu, or whatever other 'base' custom images
build in parallel while letting the derivative images reuse the newly built
image afterwards.

Signed-off-by: Robert Detjens <[email protected]>
  • Loading branch information
detjensrobert committed Sep 19, 2024
1 parent 39aef44 commit 1c4bf25
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,43 @@ env:
IMAGE: ${{ github.repository_owner }}/toolbx-images

jobs:
build:
base-images:
runs-on: ubuntu-24.04
strategy:
max-parallel: 1 # dont run these concurrently so zed picks up the new arch image
matrix:
tag:
- arch
- ubuntu

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Build Image
id: build_image
uses: redhat-actions/buildah-build@main
with:
image: ${{ env.IMAGE }}
tags: ${{ matrix.tag }}
context: ${{ matrix.tag }}
containerfiles: ./${{ matrix.tag }}/Containerfile

- name: Push To GHCR
uses: redhat-actions/push-to-registry@main
id: push-ghcr
with:
registry: ghcr.io
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
username: ${{ github.actor }}
password: ${{ github.token }}

deriv-images:
runs-on: ubuntu-24.04
needs: base-images
strategy:
matrix:
tag:
- zed

steps:
Expand Down

0 comments on commit 1c4bf25

Please sign in to comment.