Skip to content

Commit

Permalink
use buildx
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Yavorsky committed May 31, 2024
1 parent 53fca53 commit 86e270a
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions .github/workflows/aws-ecs-deploy-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 86e270a

Please sign in to comment.