Skip to content

Commit

Permalink
Produce multi-arch images
Browse files Browse the repository at this point in the history
  • Loading branch information
cyderize committed Feb 2, 2024
1 parent 826d21d commit 073b983
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,49 @@ jobs:
strategy:
matrix:
tag: ["alpine", "clang-tools", "cpp", "package", "qt", "snap", "docker-cli", "sphinx"]
include:
- tag: alpine
platforms: linux/amd64,linux/arm64
- tag: cpp
platforms: linux/amd64,linux/arm64
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
if: matrix.platforms != ''

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
if: matrix.platforms != ''

- name: Log in to the Container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- 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: |
type=raw,value=${{ matrix.tag }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.${{ matrix.tag }}
push: true
pull: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ matrix.platforms }}

0 comments on commit 073b983

Please sign in to comment.