Skip to content

Commit

Permalink
Update docker-deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
lavanya-sharma-clouddrove authored Aug 22, 2024
1 parent 406d61d commit e819ca8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/docker-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to AWS ECR
uses: aws-actions/amazon-ecr-login@v2

- 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: us-east-2

- name: Log in to AWS ECR
uses: aws-actions/amazon-ecr-login@v2

- name: Build Docker image
id: build-image
run: |
Expand All @@ -60,11 +60,11 @@ jobs:
- name: Push Docker image to Dev (with development label or no label)
if: |
(github.event_name == 'push' && (github.event.pull_request.labels != 'production')) ||
(github.event_name == 'pull_request' && github.event.pull_request.merged == false && env.ECR_REPOSITORY == secrets.DEV_ECR_URI)
(github.event_name == 'pull_request' && github.event.pull_request.merged == false && env.ECR_REPOSITORY == env.DEV_ECR_URI)
run: docker push ${{ env.ECR_REPOSITORY }}:${{ github.sha }}

- name: Push Docker image to Prod (after merge with production label or no label)
if: |
github.event_name == 'pull_request' && github.event.pull_request.merged == true &&
(env.ECR_REPOSITORY == secrets.PROD_ECR_URI)
(env.ECR_REPOSITORY == env.PROD_ECR_URI)
run: docker push ${{ env.ECR_REPOSITORY }}:${{ github.sha }}

0 comments on commit e819ca8

Please sign in to comment.