👷 build for ARM

This commit is contained in:
Louis Orleans 2023-08-31 16:27:50 -07:00
parent de768d12c1
commit d184fef5c0
No known key found for this signature in database
1 changed files with 21 additions and 0 deletions

View File

@ -34,16 +34,31 @@ jobs:
"${{ github.ref_type }}" \ "${{ github.ref_type }}" \
"${{ github.event.repository.default_branch }}" \ "${{ github.event.repository.default_branch }}" \
)" >> "$GITHUB_OUTPUT" )" >> "$GITHUB_OUTPUT"
- name: 'Set up QEMU 🦅'
id: 'qemu'
uses: 'docker/setup-qemu-action@v2'
with:
platforms: 'arm64'
- name: 'Set target build platforms 📝'
id: 'target-platforms'
run: |
echo "target_platforms=linux/amd64,linux/${{ steps.qemu.outputs.platforms }}" >> "$GITHUB_OUTPUT"
- name: 'Build container 🐳' - name: 'Build container 🐳'
id: 'build'
uses: 'docker/build-push-action@v3' uses: 'docker/build-push-action@v3'
with: with:
file: 'Dockerfile' file: 'Dockerfile'
tags: '${{ steps.tag-image.outputs.image_tags }}' tags: '${{ steps.tag-image.outputs.image_tags }}'
platforms: '${{ steps.target-platforms.outputs.target_platforms }}'
cache-from: 'type=gha' cache-from: 'type=gha'
cache-to: 'type=gha,mode=max' cache-to: 'type=gha,mode=max'
outputs: outputs:
image_tags: '${{ steps.tag-image.outputs.image_tags }}' image_tags: '${{ steps.tag-image.outputs.image_tags }}'
qemu_platforms: '${{ steps.qemu.outputs.platforms }}'
docker_platforms: '${{ steps.target-platforms.outputs.target_platforms }}'
publish: publish:
needs: needs:
@ -63,10 +78,16 @@ jobs:
username: '${{ github.repository_owner }}' username: '${{ github.repository_owner }}'
password: '${{ secrets.GITHUB_TOKEN }}' password: '${{ secrets.GITHUB_TOKEN }}'
- name: 'Set up QEMU 🦅'
uses: 'docker/setup-qemu-action@v2'
with:
platforms: '${{ needs.container-build.outputs.qemu_platforms }}'
- name: 'Publish to Registry 💨' - name: 'Publish to Registry 💨'
uses: 'docker/build-push-action@v3' uses: 'docker/build-push-action@v3'
with: with:
file: 'Dockerfile' file: 'Dockerfile'
push: true push: true
tags: '${{ needs.container-build.outputs.image_tags }}' tags: '${{ needs.container-build.outputs.image_tags }}'
platforms: '${{ needs.container-build.outputs.docker_platforms }}'
cache-from: 'type=gha' cache-from: 'type=gha'