From 075f5834bd3ecbc2a4b6147849818f4cbb4659e6 Mon Sep 17 00:00:00 2001 From: Victor Toupitzen Specian Date: Mon, 4 Mar 2024 08:29:49 -0300 Subject: [PATCH 1/5] Update pipeline.yml --- .github/workflows/pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 15ceba4..84b7af2 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -9,7 +9,7 @@ jobs: aws-auth: runs-on: ubuntu-latest outputs: - ecr_registry: ${{ steps.login-ecr.outputs.registry }} + output1: ${{ steps.login-ecr.outputs.registry }} steps: - name: Configure AWS credentials @@ -34,7 +34,7 @@ jobs: - name: Build, tag, and push image to Amazon ECR env: - ECR_REGISTRY: ${{ needs.aws-auth.outputs.ecr_registry }} + ECR_REGISTRY: ${{ needs.aws-auth.outputs.output1 }} ECR_REPOSITORY: fiap-tech-challenge-api IMAGE_TAG: latest run: | From 6963cd8f3ff45ce349356f82aceb2f3412533f6e Mon Sep 17 00:00:00 2001 From: Victor Toupitzen Specian Date: Mon, 4 Mar 2024 08:33:03 -0300 Subject: [PATCH 2/5] Update pipeline.yml --- .github/workflows/pipeline.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 84b7af2..52c3c42 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -9,7 +9,7 @@ jobs: aws-auth: runs-on: ubuntu-latest outputs: - output1: ${{ steps.login-ecr.outputs.registry }} + ecr_registry: ${{ steps.login-ecr.outputs.registry }} steps: - name: Configure AWS credentials @@ -29,14 +29,15 @@ jobs: needs: aws-auth steps: + - env: + ECR_REGISTRY: ${{ needs.aws-auth.outputs.ecr_registry }} + ECR_REPOSITORY: fiap-tech-challenge-api + IMAGE_TAG: latest + - name: Check out code uses: actions/checkout@v3 - - name: Build, tag, and push image to Amazon ECR - env: - ECR_REGISTRY: ${{ needs.aws-auth.outputs.output1 }} - ECR_REPOSITORY: fiap-tech-challenge-api - IMAGE_TAG: latest + - name: Build, tag, and push image to Amazon ECR run: | docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG From 082ee7750ae5b1964d43ae876bb24be9f61d1138 Mon Sep 17 00:00:00 2001 From: Victor Toupitzen Specian Date: Mon, 4 Mar 2024 08:37:37 -0300 Subject: [PATCH 3/5] Update pipeline.yml --- .github/workflows/pipeline.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 52c3c42..6abcf9c 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -9,7 +9,8 @@ jobs: aws-auth: runs-on: ubuntu-latest outputs: - ecr_registry: ${{ steps.login-ecr.outputs.registry }} + output_ecr_registry: ${{ steps.login-ecr.outputs.registry }} + steps: - name: Configure AWS credentials @@ -29,15 +30,15 @@ jobs: needs: aws-auth steps: - - env: - ECR_REGISTRY: ${{ needs.aws-auth.outputs.ecr_registry }} - ECR_REPOSITORY: fiap-tech-challenge-api - IMAGE_TAG: latest - + - name: Check out code uses: actions/checkout@v3 - - name: Build, tag, and push image to Amazon ECR + - name: Build, tag, and push image to Amazon ECR + env: + ECR_REGISTRY: ${{ needs.aws-auth.outputs.output_ecr_registry }} + ECR_REPOSITORY: fiap-tech-challenge-api + IMAGE_TAG: latest run: | docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG From 5e10d3be0f274ae4923d4d857865b4d7739c033b Mon Sep 17 00:00:00 2001 From: Victor Toupitzen Specian Date: Mon, 4 Mar 2024 08:40:06 -0300 Subject: [PATCH 4/5] Update pipeline.yml --- .github/workflows/pipeline.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 6abcf9c..ba23dea 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -19,6 +19,7 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-east-1 + mask-aws-account-id: 'no' - name: Login to Amazon ECR id: login-ecr From ff245f5946369270902a5c7a655232f1fcb2f7a8 Mon Sep 17 00:00:00 2001 From: Victor Toupitzen Specian Date: Mon, 4 Mar 2024 08:45:00 -0300 Subject: [PATCH 5/5] Update pipeline.yml --- .github/workflows/pipeline.yml | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index ba23dea..8738336 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -5,13 +5,15 @@ on: branches: [ "main" ] jobs: + + build: - aws-auth: runs-on: ubuntu-latest - outputs: - output_ecr_registry: ${{ steps.login-ecr.outputs.registry }} - + steps: + + - name: Check out code + uses: actions/checkout@v3 - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 @@ -19,25 +21,14 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-east-1 - mask-aws-account-id: 'no' - name: Login to Amazon ECR id: login-ecr uses: aws-actions/amazon-ecr-login@v1 - - build: - - runs-on: ubuntu-latest - needs: aws-auth - - steps: - - - name: Check out code - uses: actions/checkout@v3 - name: Build, tag, and push image to Amazon ECR env: - ECR_REGISTRY: ${{ needs.aws-auth.outputs.output_ecr_registry }} + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} ECR_REPOSITORY: fiap-tech-challenge-api IMAGE_TAG: latest run: |