Skip to content

Commit

Permalink
Log into ECR after setting credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
danieltrolezi committed Sep 21, 2024
1 parent 6605571 commit d62eba9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}

- name: Login to Amazon ECR
run: |
aws ecr get-login-password --region ${{ vars.AWS_REGION }} \
| docker login --username AWS --password-stdin ${{ secrets.ECR_REPOSITORY_URI }}
- name: Build Docker image (Octane)
run: docker build . --file Dockerfile.app --tag ${{ vars.DOCKER_IMAGE_TAG }}/octane

- name: Build Docker image (Nginx)
run: docker build . --file Dockerfile.nginx --tag ${{ vars.DOCKER_IMAGE_TAG }}/nginx

- name: Login to Amazon ECR
run: |
aws ecr get-login-password --region ${{ vars.AWS_REGION }} \
| docker login --username AWS --password-stdin ${{ secrets.ECR_REPOSITORY_URI }}
- name: Tag Docker images
run: |
docker tag ${{ vars.DOCKER_IMAGE_TAG }}/octane:latest ${{ secrets.ECR_REPOSITORY_URI }}:latest-octane
Expand Down

0 comments on commit d62eba9

Please sign in to comment.