From 86e270afd9d2245fa3ea018dd2f556a8dd17a0f4 Mon Sep 17 00:00:00 2001 From: Mike Yavorsky Date: Thu, 30 May 2024 23:56:50 -0400 Subject: [PATCH] use buildx --- .github/workflows/aws-ecs-deploy-frontend.yml | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/aws-ecs-deploy-frontend.yml b/.github/workflows/aws-ecs-deploy-frontend.yml index 510e4dcbe..f74520121 100644 --- a/.github/workflows/aws-ecs-deploy-frontend.yml +++ b/.github/workflows/aws-ecs-deploy-frontend.yml @@ -20,6 +20,7 @@ env: AWS_REGION: us-east-1 DOCKERFILE: ./frontend/Dockerfile.cloud DOCKER_PATH: ./frontend + PLATFORMS: linux/amd64,linux/arm64 jobs: setup_env: name: Set-up environment @@ -70,21 +71,23 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ env.AWS_REGION }} - - name: Login to Amazon ECR - id: login-ecr - uses: aws-actions/amazon-ecr-login@v2 - - name: Build & Push Image to ECR - uses: kciter/aws-ecr-action@v5 + - name: Login to ECR + uses: docker/login-action@v3 + with: + registry: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push + uses: docker/build-push-action@v5 with: - access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} - secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - account_id: ${{ secrets.AWS_ACCOUNT_ID }} - repo: ${{ needs.setup_env.outputs.AWS_APPENV }} - region: ${{ env.AWS_REGION }} - tags: latest,${{ needs.setup_env.outputs.IMAGE_TAG }} - dockerfile: ${{ env.DOCKERFILE }} - path: ${{ env.DOCKER_PATH }} - extra_build_args: "--build-arg ENV=${{ needs.setup_env.outputs.AWS_ENV }}" + context: ${{ env.DOCKER_PATH }} + file: ${{ env.DOCKERFILE }} + build-args: ENV=${{ needs.setup_env.outputs.AWS_ENV }} + platforms: ${{ env.PLATFORMS }} + push: true + tags: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ needs.setup_env.outputs.AWS_APPENV }}:${{ needs.setup_env.outputs.IMAGE_TAG }}, ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ needs.setup_env.outputs.AWS_APPENV }}:latest deploy: name: Deploy to AWS ECS runs-on: ubuntu-latest