From 763605a1dffa25cd8efe46132b00cc3e3deb3ce3 Mon Sep 17 00:00:00 2001 From: Aahil Date: Mon, 19 Aug 2024 16:30:58 +0100 Subject: [PATCH] Update github actions workflow for AWS ECR deployment --- .github/workflows/docker-image.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 9682410..be7ce30 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -13,15 +13,21 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v3 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION }} + - name: Log in to AWS ECR - id: ecr-login run: | aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | docker login --username AWS --password-stdin ${{ secrets.ECR_REPOSITORY }} - + - name: Build Docker image run: | docker build -t ${{ secrets.ECR_REPOSITORY }}:latest . - + - name: Tag Docker image run: | docker tag ${{ secrets.ECR_REPOSITORY }}:latest ${{ secrets.ECR_REPOSITORY }}:latest