From a9fe0817b0c0c3e8d00b6178174ce9b564bc4a43 Mon Sep 17 00:00:00 2001 From: Levente Orban Date: Wed, 27 Aug 2025 13:46:36 +0200 Subject: [PATCH] fix: github action issues --- .github/workflows/build-and-push.yml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index 6aef392..6dc7797 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -19,28 +19,38 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Set up QEMU (for multi-arch) + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log in to Container Registry + - name: Normalize image name to lowercase + run: echo "IMAGE_NAME_LC=${IMAGE_NAME,,}" >> $GITHUB_ENV + env: + IMAGE_NAME: ${{ env.IMAGE_NAME }} + + - name: Log in to GHCR uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} - password: ${{ secrets.TOKEN }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker image uses: docker/build-push-action@v5 with: context: . file: ./Dockerfile - push: ${{ github.event_name != 'pull_request' }} - cache-from: type=gha - tags: latest - cache-to: type=gha,mode=max + push: true platforms: linux/amd64,linux/arm64 + cache-from: type=gha + cache-to: type=gha,mode=max + tags: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LC }}:latest + labels: | + org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} - name: Output image info - if: github.event_name != 'pull_request' run: | - echo "Image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" + echo "Image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LC }}:latest"