-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 1023 Bytes
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Build to AWS ECR
on: push
jobs:
login-to-aws:
runs-on: ubuntu-latest
steps:
- name: Code Checkout
uses: actions/checkout@v4
- name: Login to AWS
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.PUBLIC_REGION }}
build-and-push-pub-ecr:
runs-on: ubuntu-latest
needs: login-to-aws
steps:
- name: Code Checkout
uses: actions/checkout@v4
- name: Login to AWS ECR
uses: docker/login-action@v3
with:
registry: public.ecr.aws
username: ${{ secrets.ACCESS_KEY }}
password: ${{ secrets.SECRET_ACCESS_KEY }}
env:
aws-region: ${{ secrets.PUBLIC_REGION }}
- name: Build and Push Image
run: |
docker build -t bank .
docker tag bank:latest public.ecr.aws/h8o8x8t1/bank:v1
docker push public.ecr.aws/h8o8x8t1/bank:v1