Skip to content

Commit

Permalink
Merge pull request #658 from nextcloud/feat/noid/multi-arch-images
Browse files Browse the repository at this point in the history
feat(images): Build multi-arch images
  • Loading branch information
nickvergessen authored Jan 8, 2025
2 parents e2ebc92 + 8d6d1e7 commit 1c795a9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
branches: [ master ]
paths:
- '*/Dockerfile'
- '.github/workflows/build-test.yml'
pull_request:
branches: [ master ]
paths:
- '*/Dockerfile'
- '.github/workflows/build-test.yml'

jobs:
files:
Expand Down Expand Up @@ -48,7 +50,13 @@ jobs:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0

- name: Build Docker image ${{ matrix.dockerfile }}
run: |
cd "$(dirname ${{ matrix.dockerfile }})"
docker build . --file Dockerfile
docker buildx build --platform linux/amd64,linux/arm64 . --file Dockerfile
4 changes: 4 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0

Expand All @@ -58,6 +61,7 @@ jobs:
- name: Build container image
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
with:
platforms: linux/amd64,linux/arm64
push: true
context: ${{ github.event.inputs.folderPath }}
file: '${{ github.event.inputs.folderPath }}/${{ github.event.inputs.dockerFile }}'
Expand Down

0 comments on commit 1c795a9

Please sign in to comment.