diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index eeb2aab1..a0e12f7b 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -50,34 +50,34 @@ jobs: - name: Force ECS Update run: | aws ecs update-service --cluster discovery-api-qa --service discovery-api-qa --force-new-deployment - deploy-production: - permissions: - id-token: write - contents: read - runs-on: ubuntu-latest - needs: tests - if: github.ref == 'refs/heads/production-node20' - steps: - - name: Checkout repo - uses: actions/checkout@v3 + deploy-production: + permissions: + id-token: write + contents: read + runs-on: ubuntu-latest + needs: tests + if: github.ref == 'refs/heads/production-node20' + steps: + - name: Checkout repo + uses: actions/checkout@v3 - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: arn:aws:iam::946183545209:role/GithubActionsDeployerRole - aws-region: us-east-1 + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: arn:aws:iam::946183545209:role/GithubActionsDeployerRole + aws-region: us-east-1 - - name: Log in to ECR - id: login-ecr - uses: aws-actions/amazon-ecr-login@v1 + - name: Log in to ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v1 - - name: Build, tag, and push image to Amazon ECR - env: - ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} - ECR_REPOSITORY: discovery-api - IMAGE_TAG: ${{ github.sha }} - run: | - docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . - docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG - docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:production-latest - docker push $ECR_REGISTRY/$ECR_REPOSITORY:production-latest + - name: Build, tag, and push image to Amazon ECR + env: + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + ECR_REPOSITORY: discovery-api + IMAGE_TAG: ${{ github.sha }} + run: | + docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . + docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG + docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:production-latest + docker push $ECR_REGISTRY/$ECR_REPOSITORY:production-latest