Add ARM build in GitHub Actions

- Hint: Tried to use the plattform parameter of the build-push-action,
   however this failed with an error in the Jobs.
   Therefore, I used a matrix with the platforms.
 - The ARM build takes a long time.
This commit is contained in:
Markus Opolka
2023-04-05 14:28:38 +02:00
parent 0732424f79
commit 663bf2f03b
5 changed files with 46 additions and 13 deletions

View File

@@ -15,7 +15,7 @@ jobs:
- 5.0/fpm-alpine/Dockerfile
- 5.0/fpm/Dockerfile
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: hadolint/hadolint-action@v1.5.0
with:
dockerfile: ${{ matrix.dockerfile }}
@@ -29,11 +29,20 @@ jobs:
permissions:
packages: write
contents: read
strategy:
matrix:
platform:
- linux/amd64
- linux/arm64
steps:
- name: 'Check out the repo'
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: 'Set up QEMU'
uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64,arm'
- name: 'Set up Docker Buildx'
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
with:
buildkitd-flags: --debug
- name: 'Log in to DockerHub'
@@ -61,6 +70,7 @@ jobs:
push: true
tags: ${{ steps.metadata-apache.outputs.tags }}
labels: ${{ steps.metadata-apache.outputs.labels }}
platforms: ${{ matrix.platform }}
- name: 'FPM variant metadata'
id: metadata-fpm
@@ -81,6 +91,7 @@ jobs:
push: true
tags: ${{ steps.metadata-fpm.outputs.tags }}
labels: ${{ steps.metadata-apache.outputs.labels }}
platforms: ${{ matrix.platform }}
- name: 'FPM Alpine variant metadata'
id: metadata-fpm-alpine
@@ -101,3 +112,4 @@ jobs:
push: true
tags: ${{ steps.metadata-fpm-alpine.outputs.tags }}
labels: ${{ steps.metadata-apache.outputs.labels }}
platforms: ${{ matrix.platform }}