diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c528dc1..64d0c94 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,6 @@ name: Build to AWS ECR -on: push +on: push jobs: login-to-aws: @@ -14,28 +14,25 @@ jobs: with: aws-access-key-id: ${{ secrets.ACCESS_KEY }} aws-secret-access-key: ${{ secrets.SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.PUBLIC_REGION }} + aws-region: ${{ secrets.REGION }} build-and-push-pub-ecr: runs-on: ubuntu-latest - needs: - login-to-aws: - + needs: login-to-aws + steps: - name: Code Checkout uses: actions/checkout@v4 - - name: Login to AWSECR + - name: Login to AWS ECR uses: docker/login-action@v3 with: registry: public.ecr.aws username: ${{ secrets.ACCESS_KEY }} password: ${{ secrets.SECRET_ACCESS_KEY }} - env: - aws-region: ${{ secrets.PUBLIC_REGION }} - - - name: Build Image + + - name: Build and Push Image run: | - docker build -t bank . - docker tag bank:latest public.ecr.aws/h8o8x8t1/bank:v2 - docker push public.ecr.aws/h8o8x8t1/bank:v2 + docker build -t bank . + docker tag bank:latest public.ecr.aws/h8o8x8t1/bank:v1 + docker push public.ecr.aws/h8o8x8t1/bank:v1