From 2119f647552a7183430139946739a4dda14b7f07 Mon Sep 17 00:00:00 2001 From: David Wertenteil Date: Thu, 19 May 2022 09:29:51 +0300 Subject: [PATCH] using buildx for building images --- .github/workflows/build.yaml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5d6d2a4..e2bddff 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -71,20 +71,19 @@ jobs: id: image-name run: echo '::set-output name=IMAGE_NAME::quay.io/${{ github.repository_owner }}/notification-server' - - name: Build the Docker image - run: docker build . --file build/Dockerfile --tag ${{ steps.image-name.outputs.IMAGE_NAME }}:${{ steps.image-version.outputs.IMAGE_VERSION }} --build-arg image_version=${{ steps.image-version.outputs.IMAGE_VERSION }} - - - name: Re-Tag Image to latest - run: docker tag ${{ steps.image-name.outputs.IMAGE_NAME }}:${{ steps.image-version.outputs.IMAGE_VERSION }} ${{ steps.image-name.outputs.IMAGE_NAME }}:latest - + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to Quay.io env: # Or as an environment variable QUAY_PASSWORD: ${{ secrets.QUAYIO_REGISTRY_PASSWORD }} QUAY_USERNAME: ${{ secrets.QUAYIO_REGISTRY_USERNAME }} run: docker login -u="${QUAY_USERNAME}" -p="${QUAY_PASSWORD}" quay.io - - name: Push Docker image - run: | - docker push ${{ steps.image-name.outputs.IMAGE_NAME }}:${{ steps.image-version.outputs.IMAGE_VERSION }} - docker push ${{ steps.image-name.outputs.IMAGE_NAME }}:latest + - name: Build the Docker image + run: docker buildx build . --file build/Dockerfile --tag ${{ steps.image-name.outputs.IMAGE_NAME }}:${{ steps.image-version.outputs.IMAGE_VERSION }} --tag ${{ steps.image-name.outputs.IMAGE_NAME }}:latest --build-arg image_version=${{ steps.image-version.outputs.IMAGE_VERSION }} --push --platform linux/amd64,linux/arm64 + \ No newline at end of file