diff --git a/.github/workflows/ecr-push.yml b/.github/workflows/ecr-push.yml index 890c43b..4c5ff49 100644 --- a/.github/workflows/ecr-push.yml +++ b/.github/workflows/ecr-push.yml @@ -31,13 +31,25 @@ jobs: id: login-ecr uses: aws-actions/amazon-ecr-login@v2 +# - name: Build, tag, and push image to Amazon ECR +# id: build-image +# env: +# ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} +# ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }} +# IMAGE_TAG: latest +# run: | +# docker buildx build --platform=linux/amd64 -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . +# docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG +# echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" + - name: Build, tag, and push image to Amazon ECR id: build-image + uses: docker/build-push-action@v3 env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }} IMAGE_TAG: latest - run: | - docker buildx build --platform=linux/amd64 -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . - docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG - echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" + with: + context: . + push: true + tags: $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG