diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0c48b14..f7d32dc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build to AWS ECR +name: Build to AWS Public ECR on: push @@ -9,14 +9,14 @@ jobs: - name: Code Checkout uses: actions/checkout@v4 - - name: Login to AWS + - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.ACCESS_KEY }} aws-secret-access-key: ${{ secrets.SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.REGION }} - - build-and-push-pub-ecr: + aws-region: ${{ secrets.PUBLIC_REGION }} + + build-and-push-public-ecr: runs-on: ubuntu-latest needs: login-to-aws @@ -24,17 +24,13 @@ jobs: - name: Code Checkout uses: actions/checkout@v4 - - name: Login to AWS ECR - uses: docker/login-action@v3 + - name: Login to AWS Public ECR + uses: aws-actions/amazon-ecr-login@v2 with: - registry: public.ecr.aws - username: ${{ secrets.ACCESS_KEY }} - password: ${{ secrets.SECRET_ACCESS_KEY }} - env: - aws-region: ${{ secrets.PUBLIC_REGION }} + registry-type: public - - name: Build and Push Image + - name: Build and Push Image to Public ECR run: | docker build -t bank . - docker tag bank:latest public.ecr.aws/h8o8x8t1/bank:v2 - docker push public.ecr.aws/h8o8x8t1/bank:v2 + docker tag bank:latest public.ecr.aws/h8o8x8t1/bank:v3 + docker push public.ecr.aws/h8o8x8t1/bank:v3