From 76ba29b73336a3f1914a917e4ad74bbc66fd8998 Mon Sep 17 00:00:00 2001 From: David Smith <1734595+daveismith@users.noreply.github.com> Date: Tue, 23 Jul 2024 20:37:01 -0400 Subject: [PATCH] Switching to matrix build Updates to use a matrix build --- .github/workflows/release-to-ghcr.yaml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-to-ghcr.yaml b/.github/workflows/release-to-ghcr.yaml index d7d950c..1fd7c46 100644 --- a/.github/workflows/release-to-ghcr.yaml +++ b/.github/workflows/release-to-ghcr.yaml @@ -14,7 +14,20 @@ env: jobs: build-and-push-image: runs-on: ubuntu-latest - + strategy: + matrix: + include: + - context: backend/ShootTheMoon + file: backend/ShootTheMoon/ShootTheMoon/Dockerfile + name: backend + - context: proxy + file: proxy/Dockerfile + name: proxy + - context: frontend/shoot-client + file: frontend/shoot-client/Dockerfile + name: frontend + + permissions: contents: read packages: write @@ -39,14 +52,14 @@ jobs: id: meta uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + images: ${{ env.REGISTRY }}/${{ matrix.name }} - name: Build and push Docker image id: push uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 with: - context: backend/ShootTheMoon - file: backend/ShootTheMoon/ShootTheMoon/Dockerfile + context: ${{ matrix.context }} + file: ${{ matrix.file }} push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} @@ -54,6 +67,6 @@ jobs: - name: Generate artifact attestation uses: actions/attest-build-provenance@v1 with: - subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} + subject-name: ${{ env.REGISTRY }}/${{ matrix.name }} subject-digest: ${{ steps.push.outputs.digest }} push-to-registry: true \ No newline at end of file