From a5cc64d6e267ad27fcac554b16f5d33bb8763f7d Mon Sep 17 00:00:00 2001 From: Jason Madigan Date: Wed, 18 Dec 2024 20:20:13 +0000 Subject: [PATCH] explicit image Signed-off-by: Jason Madigan --- .github/workflows/dev-build.yaml | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dev-build.yaml b/.github/workflows/dev-build.yaml index 0ef7f50..7f9ad0a 100644 --- a/.github/workflows/dev-build.yaml +++ b/.github/workflows/dev-build.yaml @@ -7,11 +7,12 @@ on: workflow_dispatch: env: - IMAGE_NAME: quay.io/kuadrant/console-plugin + IMAGE_BASE_NAME: kuadrant/console-plugin + REGISTRY: quay.io jobs: build: - name: Dev Build from Main + name: Build and Push Multi-Arch Image runs-on: ubuntu-22.04 strategy: fail-fast: false @@ -31,17 +32,36 @@ jobs: id: build uses: redhat-actions/buildah-build@v2 with: - image: ${{ env.IMAGE_NAME }} + image: ${{ env.IMAGE_BASE_NAME }}-${{ matrix.arch }} tags: latest archs: ${{ matrix.arch }} containerfiles: | ./Dockerfile - - name: Push Image + - name: Push Architecture-Specific Image uses: redhat-actions/push-to-registry@v2 with: - registry: quay.io + registry: ${{ env.REGISTRY }} username: ${{ secrets.QUAY_USER }} password: ${{ secrets.QUAY_PASSWORD }} - image: kuadrant/console-plugin + image: ${{ env.IMAGE_BASE_NAME }}-${{ matrix.arch }} tags: latest + + manifest: + name: Create and Push Multi-Arch Manifest + needs: build + runs-on: ubuntu-22.04 + steps: + - name: Install Buildah + run: sudo apt-get update && sudo apt-get install -y buildah + + - name: Create Manifest + run: | + buildah manifest create ${{ env.REGISTRY }}/${{ env.IMAGE_BASE_NAME }}:latest + buildah manifest add ${{ env.REGISTRY }}/${{ env.IMAGE_BASE_NAME }}:latest docker://${{ env.REGISTRY }}/${{ env.IMAGE_BASE_NAME }}-amd64:latest + buildah manifest add ${{ env.REGISTRY }}/${{ env.IMAGE_BASE_NAME }}:latest docker://${{ env.REGISTRY }}/${{ env.IMAGE_BASE_NAME }}-arm64:latest + + - name: Push Multi-Arch Manifest + run: | + buildah manifest push --all ${{ env.REGISTRY }}/${{ env.IMAGE_BASE_NAME }}:latest docker://${{ env.REGISTRY }}/${{ env.IMAGE_BASE_NAME }}:latest \ + --creds=${{ secrets.QUAY_USER }}:${{ secrets.QUAY_PASSWORD }}