From d81577d5920c3589a688d2d223a7d0fb4206842e Mon Sep 17 00:00:00 2001 From: Seth Lawler Date: Thu, 24 Oct 2024 15:08:57 -0400 Subject: [PATCH] Update ecr-push.yml --- .github/workflows/ecr-push.yml | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ecr-push.yml b/.github/workflows/ecr-push.yml index 633ac8b..6b04928 100644 --- a/.github/workflows/ecr-push.yml +++ b/.github/workflows/ecr-push.yml @@ -28,28 +28,22 @@ jobs: role-session-name: updateimage aws-region: ${{ secrets.AWS_REGION }} - - name: Login to Amazon ECR + - name: Login to Amazon ECR Public id: login-ecr - uses: aws-actions/amazon-ecr-login@v2 - with: - registry-type: public - + uses: aws-actions/amazon-ecr-public-login@v1 - - - name: Build, tag, and push API docker image to Amazon ECR + - name: Build, tag, and push API docker image to Amazon ECR Public id: build-publish shell: bash env: - REGISTRY: ${{ steps.login-ecr-public.outputs.registry }} - REGISTRY_ALIAS: "dewberry" - REPOSITORY: "ras-stac" + ECR_REGISTRY: "public.ecr.aws/dewberry" + ECR_REPOSITORY: ${{ secrets.ECR_REPO_NAME }} IMAGE_TAG: ${{ github.sha }} run: | - - docker build . -t "$REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG" - docker push "$REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG" - docker tag "$REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG" "$ECR_REGISTRY/$ECR_REPOSITORY:latest" - docker push "$REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:latest" - - echo "IMAGE $IMAGE_TAG is pushed to $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY" - echo "$REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG overwrote $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:latest" + 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:latest" + docker push "$ECR_REGISTRY/$ECR_REPOSITORY:latest" + + echo "IMAGE $IMAGE_TAG is pushed to $ECR_REGISTRY/$ECR_REPOSITORY" + echo "$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG overwrote $ECR_REGISTRY/$ECR_REPOSITORY:latest"