Skip to content

Commit c8d8e70

Browse files
committed
add ecr to main.yml
1 parent cdc1a42 commit c8d8e70

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/main.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,23 @@ jobs:
8585
push: true
8686
tags: |
8787
${{ secrets.DOCKER_HUB_USERNAME }}/aws-integration:v1.0.${{ github.run_number }}
88+
89+
# --- AWS ECR Public Login + Push ---
90+
- name: Configure AWS credentials
91+
uses: aws-actions/configure-aws-credentials@v4
92+
with:
93+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
94+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
95+
aws-region: us-east-1 # Public ECR lives here
96+
97+
- name: Login to Amazon ECR Public
98+
uses: aws-actions/amazon-ecr-login@v2
99+
with:
100+
registry-type: public
101+
102+
- name: Tag and push to ECR Public
103+
run: |
104+
IMAGE_TAG=v1.0.${{ github.run_number }}
105+
ECR_URI=public.ecr.aws/d9h7a7q0/saadsabahuddin/public-repo
106+
docker tag ${{ secrets.DOCKER_HUB_USERNAME }}/aws-integration:$IMAGE_TAG $ECR_URI:$IMAGE_TAG
107+
docker push $ECR_URI:$IMAGE_TAG

0 commit comments

Comments
 (0)