Skip to content

Commit b50f66d

Browse files
authored
Merge pull request #6 from udacity/amalF-patch-1
Add GitHub Actions workflow for ECR deployment
2 parents c7f2a41 + ebf0e5f commit b50f66d

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Build and Push to ECR
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build-and-push:
8+
runs-on: ubuntu-latest
9+
defaults:
10+
run:
11+
working-directory: module-17-ecs/demo
12+
13+
steps:
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.AWS_ACCESS_KEY_ID }}
20+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
21+
aws-region: us-east-1
22+
23+
- name: Login to ECR
24+
id: ecr-login
25+
uses: aws-actions/amazon-ecr-login@v2
26+
27+
- name: Build, tag, and push image
28+
env:
29+
ECR_REGISTRY: ${{ steps.ecr-login.outputs.registry }}
30+
run: |
31+
docker build -t $ECR_REGISTRY/ner-api:latest .
32+
docker push $ECR_REGISTRY/ner-api:latest

0 commit comments

Comments
 (0)