From e7a5cd6378116e306201b86df30c4f861df93446 Mon Sep 17 00:00:00 2001 From: Trey <73353716+TreyWW@users.noreply.github.com> Date: Sun, 20 Oct 2024 21:03:37 +0100 Subject: [PATCH] Update publish_to_github_packages.yml --- .github/workflows/publish_to_github_packages.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish_to_github_packages.yml b/.github/workflows/publish_to_github_packages.yml index cb6cf5f5..1fbd868f 100644 --- a/.github/workflows/publish_to_github_packages.yml +++ b/.github/workflows/publish_to_github_packages.yml @@ -62,7 +62,10 @@ jobs: run: | echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - name: Build, tag, and push image to GitHub Packages + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build and push multi-platform image to GitHub Packages id: build-image env: IMAGE_NAME: ghcr.io/treyww/myfinances @@ -71,13 +74,11 @@ jobs: cp infrastructure/backend/Dockerfile ./Dockerfile echo "VERSION IS: ${{ steps.set_version.outputs.version }} or $IMAGE_TAG" - # Build and push versioned image - docker build -t $IMAGE_NAME:$IMAGE_TAG . - docker push $IMAGE_NAME:$IMAGE_TAG + # Build and push the multi-platform image + docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE_NAME:$IMAGE_TAG . --push # Optionally build and push 'latest' tag - docker build -t $IMAGE_NAME:latest . - docker push $IMAGE_NAME:latest + docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE_NAME:latest . --push echo "::set-output name=image::$IMAGE_NAME:$IMAGE_TAG" echo "::set-output name=latest_image::$IMAGE_NAME:latest"