diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 897ec49ec..061d91c9e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,18 +48,20 @@ jobs: pnpm nx affected --base=last-release -t version --parallel=1 - name: Setup AWS ECR Details - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: eu-west-1 - - name: Login to Amazon ECR - id: login-pf-aws-ecr - uses: aws-actions/amazon-ecr-login@v1 + - name: Sign in to Amazon ECR + if: github.ref == 'refs/heads/main' + id: ecr-sign-in + uses: aws-actions/amazon-ecr-login@v2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + if: github.ref == 'refs/heads/main' + uses: docker/setup-buildx-action@v3 - name: Build docker if: github.ref == 'refs/heads/main' @@ -67,12 +69,12 @@ jobs: pnpm nx affected --base=last-release -t docker --parallel=1 - name: Push docker + if: github.ref == 'refs/heads/main' env: - ECR_REGISTRY: ${{ steps.login-pf-aws-ecr.outputs.registry }} + ECR_REGISTRY: ${{ steps.ecr-sign-in.outputs.registry }} ECR_REPOSITORY: life-events-design-system IMAGE_TAG: latest run: | - docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG - name: Tag last-release