-
Notifications
You must be signed in to change notification settings - Fork 0
29 lines (23 loc) · 764 Bytes
/
Copy pathdeploy.yml
File metadata and controls
29 lines (23 loc) · 764 Bytes
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
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::336658617711:role/github-ecr-role
aws-region: ap-south-1
- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v2
- name: Build Docker image
run: |
docker build -t fastapi-demo .
- name: Tag and push image
run: |
docker tag fastapi-demo:latest 336658617711.dkr.ecr.ap-south-1.amazonaws.com/fastapi-demo:latest
docker push 336658617711.dkr.ecr.ap-south-1.amazonaws.com/fastapi-demo:latest