Skip to content

Commit

Permalink
git actions worflow change: deploy to each ECR Repos (prod, main) for…
Browse files Browse the repository at this point in the history
… different branch push event
  • Loading branch information
leobang17 committed Apr 26, 2024
1 parent 08c267a commit db98476
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/push-image-to-ecr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- develop

jobs:
build-and-push:
Expand All @@ -28,7 +29,7 @@ jobs:
- name: Build, tag, and push image to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }}
ECR_REPOSITORY: ${{ github.ref == 'refs/heads/main' && secrets.ECR_REPOSITORY_PROD || secrets.ECR_REPOSITORY_DEV }}
IMAGE_TAG: latest
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
Expand Down

0 comments on commit db98476

Please sign in to comment.