From 362682aeb087609d656e33f5886de4c18aa3d07f Mon Sep 17 00:00:00 2001 From: Benjamin Bolte Date: Mon, 20 May 2024 16:10:22 -0700 Subject: [PATCH] tweak deploy action --- .github/workflows/deploy.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7fa3adce..51ad7610 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,9 +20,15 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/GitHubActionsRole + aws-region: ${{ secrets.AWS_REGION }} + - name: Log in to Amazon ECR id: login-ecr - uses: aws-actions/amazon-ecr-login@v1 + uses: aws-actions/amazon-ecr-login@v2 - name: Build, tag, and push Docker image env: @@ -33,12 +39,6 @@ jobs: docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f docker/Dockerfile . docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/GitHubActionsRole - aws-region: ${{ secrets.AWS_REGION }} - - name: Update Lambda function to use new Docker image env: FUNCTION_NAME: ${{ secrets.LAMBDA_FUNCTION_NAME }}