Skip to content

Commit

Permalink
Refactor docker workflow to multiplatform build
Browse files Browse the repository at this point in the history
Upgrades out of date action & adds dependency actions (QEMU & BuildX) for multiplatform build. Sets platforms to Linux/amd64 and Linux/arm64
  • Loading branch information
khakers committed Nov 5, 2023
1 parent e46fbb1 commit 4a8d293
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3


- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
Expand All @@ -36,7 +42,7 @@ jobs:

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
Expand All @@ -51,9 +57,13 @@ jobs:
type=raw,value=latest,enable=${{ github.event.release.prerelease == false }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# Use Github Cache BAckend
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 4a8d293

Please sign in to comment.