From 0dbb0b028c85e429f2843cade74e3ff734a9bb62 Mon Sep 17 00:00:00 2001 From: Nagendra Dhanakeerthi Date: Thu, 25 Apr 2024 16:17:39 +0400 Subject: [PATCH] BuildX fix for UI service --- .github/workflows/ui-docker-build.yml | 26 ++++++++++++++----- .../workflows/ui-docker-hub-push-tags.yaml | 6 ++++- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ui-docker-build.yml b/.github/workflows/ui-docker-build.yml index 46424098..ba96ab2c 100644 --- a/.github/workflows/ui-docker-build.yml +++ b/.github/workflows/ui-docker-build.yml @@ -19,11 +19,25 @@ jobs: - name: Checkout Code uses: actions/checkout@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to Docker Hub - run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login --username ${{ secrets.DOCKER_USERNAME }} --password-stdin - + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build and Push Docker image - run: | - docker build -t ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} -t ${{ env.IMAGE_NAME }}:${{ github.sha }} -f ui/Dockerfile ./ui - docker push ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} - docker push ${{ env.IMAGE_NAME }}:${{ github.sha }} + uses: docker/build-push-action@v2 + with: + context: ./ui + file: ./ui/Dockerfile + push: true + tags: | + ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} + ${{ env.IMAGE_NAME }}:${{ github.sha }} + platforms: linux/amd64,linux/arm64 diff --git a/.github/workflows/ui-docker-hub-push-tags.yaml b/.github/workflows/ui-docker-hub-push-tags.yaml index f45ce002..adb02b1c 100644 --- a/.github/workflows/ui-docker-hub-push-tags.yaml +++ b/.github/workflows/ui-docker-hub-push-tags.yaml @@ -13,6 +13,9 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -29,7 +32,7 @@ jobs: images: | multiwoven/multiwoven-ui - - name: Build and push server Docker image + - name: Build and push UI Docker image uses: docker/build-push-action@v5 with: context: ./ui @@ -37,3 +40,4 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64