From 6674dd83b1783a2eed584b0bb31c7bd1e6598895 Mon Sep 17 00:00:00 2001 From: Rene Gassmoeller Date: Fri, 16 Jun 2023 10:18:47 -0600 Subject: [PATCH] Push to ghcr and build for Apple Silicon --- .github/workflows/docker.yml | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d260ac56..84273554 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -23,24 +23,37 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Login to DockerHub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_LOGIN }} - - name: Build and push Docker image for master + - name: Build and push Docker image for main if: contains(github.event_name, 'push') - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: context: ./docker/rayleigh/ cache-from: type=registry,ref=geodynamics/rayleigh-buildenv-jammy cache-to: type=inline + platforms: linux/amd64,linux/arm64 push: true - tags: geodynamics/rayleigh:latest + tags: | + ghcr.io/${{ github.repository }}:latest + ${{ github.repository }}:latest - name: Build and push Docker image for release if: contains(github.event_name, 'release') @@ -49,6 +62,8 @@ jobs: context: ./docker/rayleigh/ cache-from: type=registry,ref=geodynamics/rayleigh-buildenv-jammy cache-to: type=inline + platforms: linux/amd64,linux/arm64 push: true - tags: geodynamics/rayleigh:${{github.ref_name}} - + tags: | + ghcr.io/${{ github.repository }}:${{github.ref_name}} + ${{ github.repository }}:${{github.ref_name}}