Skip to content

Commit cb8c419

Browse files
Update CI/CD to push from main to latest in AWS public ECR (#6)
1 parent 76e6bf9 commit cb8c419

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish main to AWS public ECR latest
2+
3+
# Doesn't actually push to the ECR at the moment: just an example
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
publish-to-aws-ecr:
12+
runs-on: ubuntu-latest
13+
env:
14+
ENVIRONMENT: prod
15+
IMAGE_NAME: ${{ vars.PUBLICECR_URI }}
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Configure AWS credentials
21+
uses: aws-actions/configure-aws-credentials@v4
22+
with:
23+
aws-access-key-id: ${{ secrets.PUBLICECR_UPLOAD_ACCESS_KEY_ID }}
24+
aws-secret-access-key: ${{ secrets.PUBLICECR_UPLOAD_SECRET_ACCESS_KEY }}
25+
aws-region: ${{ vars.PUBLICECR_REGION }}
26+
27+
- name: Authenticate with AWS Public ECR
28+
uses: aws-actions/amazon-ecr-login@v2
29+
with:
30+
registry-type: public
31+
32+
- name: Build
33+
run: |
34+
# docker build -t ${{ vars.PUBLICECR_URI }}:latest .
35+
make build
36+
37+
- name: Publish To AWS ECR
38+
run: |
39+
# 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)