Build multi-platform docker image

This commit is contained in:
JP Simard 2022-03-13 12:00:47 -04:00
parent 702b36a781
commit dba6efe46e
No known key found for this signature in database
GPG Key ID: 184C3F2916202C58
1 changed files with 13 additions and 9 deletions

View File

@ -3,14 +3,14 @@ name: docker
on: on:
push: push:
branches: branches:
- master - '*'
tags: tags:
- '*' - '*'
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -29,20 +29,24 @@ jobs:
echo "REPOSITORY_LC=${REPOSITORY,,}" >>${GITHUB_ENV} echo "REPOSITORY_LC=${REPOSITORY,,}" >>${GITHUB_ENV}
env: env:
REPOSITORY: '${{ github.repository }}' REPOSITORY: '${{ github.repository }}'
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
- name: Login to Github registry - name: Log in to Github registry
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io registry: ghcr.io
- uses: docker/build-push-action@v2 - uses: docker/build-push-action@v2
with: with:
push: true platforms: linux/amd64,linux/arm64
push: false # TODO: true
tags: ghcr.io/${{ env.REPOSITORY_LC }}:${{ env.DOCKER_TAG }} tags: ghcr.io/${{ env.REPOSITORY_LC }}:${{ env.DOCKER_TAG }}
build_5_5: build_5_5:
@ -79,6 +83,6 @@ jobs:
- uses: docker/build-push-action@v2 - uses: docker/build-push-action@v2
with: with:
push: true push: false # TODO: true
file: Dockerfile@swift-5.5 file: Dockerfile@swift-5.5
tags: ghcr.io/${{ env.REPOSITORY_LC }}:5.5-${{ env.DOCKER_TAG }} tags: ghcr.io/${{ env.REPOSITORY_LC }}:5.5-${{ env.DOCKER_TAG }}