Skip to content

Commit b6e186f

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

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
env:
13+
ENVIRONMENT: prod
14+
IMAGE_NAME: ${{ vars.PUBLICECR_URI }}
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Configure AWS credentials
20+
uses: aws-actions/configure-aws-credentials@v4
21+
with:
22+
aws-access-key-id: ${{ secrets.PUBLICECR_UPLOAD_ACCESS_KEY_ID }}
23+
aws-secret-access-key: ${{ secrets.PUBLICECR_UPLOAD_SECRET_ACCESS_KEY }}
24+
aws-region: ${{ vars.PUBLICECR_REGION }}
25+
26+
- name: Authenticate with AWS Public ECR
27+
uses: aws-actions/amazon-ecr-login@v2
28+
with:
29+
registry-type: public
30+
31+
- name: Build
32+
run: |
33+
# docker build -t ${{ vars.PUBLICECR_URI }}:latest .
34+
make build
35+
36+
- name: Publish To AWS ECR
37+
run: |
38+
# docker push ${{ vars.PUBLICECR_URI }}:latest

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ tmp
1313
.idea
1414
htmlcov
1515
.pdm-python
16+
*~

0 commit comments

Comments
 (0)