Skip to content

Commit

Permalink
build: updates image building strategy to use GHA cache (#57)
Browse files Browse the repository at this point in the history
Signed-off-by: Jennifer Power <[email protected]>
  • Loading branch information
jpower432 committed Oct 16, 2023
1 parent 8261e91 commit 23b290b
Showing 1 changed file with 15 additions and 22 deletions.
37 changes: 15 additions & 22 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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

0 comments on commit 23b290b

Please sign in to comment.