Skip to content

Commit

Permalink
fixup! try: build arch in matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusknorr committed Dec 1, 2023
1 parent a888fdd commit 8ce6435
Showing 1 changed file with 16 additions and 24 deletions.
40 changes: 16 additions & 24 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ jobs:
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: nextcloud-dev-${{ matrix.container }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
Expand Down Expand Up @@ -58,12 +63,16 @@ jobs:
with:
push: false
context: docker/
platforms: linux/amd64,linux/arm64
platforms: ${{ matrix.platform }}
file: ${{ steps.dockerfile.outputs.DOCKERFILE }}
tags: |
ghcr.io/juliushaertl/nextcloud-dev-${{ matrix.container }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
outputs: type=image,name=nextcloud-dev-${{ matrix.container }},push-by-digest=true,name-canonical=true,push=true
- name: Build and push by digest
id: build
uses: docker/build-push-action@v5
with:
context: .
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
- name: Export digest
run: |
mkdir -p /tmp/digests
Expand All @@ -76,23 +85,6 @@ jobs:
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
- name: Push container image
uses: docker/build-push-action@v5
if: github.ref == 'refs/heads/master'
with:
push: true
context: docker/
platforms: linux/amd64,linux/arm64
file: ${{ steps.dockerfile.outputs.DOCKERFILE }}
tags: |
ghcr.io/juliushaertl/nextcloud-dev-${{ matrix.container }}:${{ github.sha }}
ghcr.io/juliushaertl/nextcloud-dev-${{ matrix.container }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

merge:
runs-on: ubuntu-latest
Expand All @@ -114,7 +106,7 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
images: nextcloud-dev-${{ matrix.container }}
- name: Login to GitHub Container Registry
if: needs.prepare.outputs.push == 'true'
uses: docker/login-action@v3
Expand All @@ -129,6 +121,6 @@ jobs:
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
docker buildx imagetools inspect ${{ steps.meta.outputs.name }} :${{ steps.meta.outputs.version }}

0 comments on commit 8ce6435

Please sign in to comment.