From 23b290ba5ab172e3298a910e9b9f13fce86add9c Mon Sep 17 00:00:00 2001 From: Jennifer Power Date: Mon, 16 Oct 2023 11:02:41 -0400 Subject: [PATCH] build: updates image building strategy to use GHA cache (#57) Signed-off-by: Jennifer Power --- .github/workflows/publish.yml | 37 ++++++++++++++--------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5ce96742..fbb973b5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,8 +23,14 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - - name: Log in to registry - uses: redhat-actions/podman-login@v1 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Quay + uses: docker/login-action@v3 with: username: ${{ secrets.QUAY_USER }} password: ${{ secrets.QUAY_TOKEN }} @@ -46,24 +52,11 @@ jobs: run: echo "TAG=$INPUT_VERSION" >> "$GITHUB_ENV" env: INPUT_VERSION: ${{ github.event.inputs.tag }} - - - name: Build image with Buildah - id: build_image - uses: redhat-actions/buildah-build@v2 + + - name: Build and Push + uses: docker/build-push-action@v5 with: - image: ${{ env.IMAGE_NAME }} - tags: ${{ env.TAG }} - containerfiles: | - ./Dockerfile - - - name: Push To registry - uses: redhat-actions/push-to-registry@v2 - id: push - with: - image: ${{ steps.build_image.outputs.image }} - tags: ${{ steps.build_image.outputs.tags }} - registry: ${{ env.IMAGE_REGISTRY }}/${{ vars.QUAY_ORG }} - - - name: Echo outputs - run: | - echo "${{ toJSON(steps.push.outputs) }}" + push: true + tags: ${{ env.IMAGE_REGISTRY }}/${{ vars.QUAY_ORG }}/${{ env.IMAGE_NAME }}:${{ env.TAG }} + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file