Skip to content

Commit

Permalink
Update ecr-push.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
slawler authored Oct 24, 2024
1 parent e9e6e35 commit d81577d
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions .github/workflows/ecr-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit d81577d

Please sign in to comment.