Skip to content

Commit f460d7b

Browse files
Update CI/CD to push from main to latest in AWS public ECR
1 parent 76e6bf9 commit f460d7b

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish main to AWS public ECR latest
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- update_cicd
8+
9+
jobs:
10+
publish-to-aws-ecr:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Configure AWS credentials
17+
uses: aws-actions/configure-aws-credentials@v4
18+
with:
19+
aws-access-key-id: ${{ secrets.PUBLICECR_UPLOAD_ACCESS_KEY_ID }}
20+
aws-secret-access-key: ${{ secrets.PUBLICECR_UPLOAD_SECRET_ACCESS_KEY }}
21+
aws-region: ${{ vars.PUBLICECR_REGION }}
22+
23+
- name: Authenticate with AWS Public ECR
24+
uses: aws-actions/amazon-ecr-login@v2
25+
with:
26+
registry-type: public
27+
28+
- name: Build
29+
run: |
30+
docker build -t ${{ vars.PUBLICECR_URI }}:latest .
31+
32+
- name: Publish To AWS ECR
33+
run: |
34+
docker push ${{ vars.PUBLICECR_URI }}:latest

0 commit comments

Comments
 (0)