Skip to content

Commit

Permalink
Update github actions workflow for AWS ECR deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Aahil13 committed Aug 19, 2024
1 parent 37926c2 commit 763605a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,21 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Log in to AWS ECR
id: ecr-login
run: |
aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | docker login --username AWS --password-stdin ${{ secrets.ECR_REPOSITORY }}
- name: Build Docker image
run: |
docker build -t ${{ secrets.ECR_REPOSITORY }}:latest .
- name: Tag Docker image
run: |
docker tag ${{ secrets.ECR_REPOSITORY }}:latest ${{ secrets.ECR_REPOSITORY }}:latest
Expand Down

0 comments on commit 763605a

Please sign in to comment.