From f39aedd516fc449b4ba43408d170b3ce42eab506 Mon Sep 17 00:00:00 2001 From: Paulius J Date: Thu, 18 Jan 2024 12:40:45 +0100 Subject: [PATCH] fix image build --- .github/workflows/go.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index fde29df..dc368aa 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -52,15 +52,19 @@ jobs: runs-on: ubuntu-latest needs: [lint, test] if: startsWith(github.event.ref, 'refs/tags/v') + env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} steps: - - name: Check out the repo - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 - name: Log in to Docker Hub uses: docker/login-action@v3 with: - registry: ghcr.io + registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} @@ -68,13 +72,17 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: teamwork/kommentaar + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Build and push Docker image uses: docker/build-push-action@v5 with: context: . + platforms: linux/amd64,linux/arm64 file: ./Dockerfile push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max +