diff --git a/.github/workflows/aws.yml b/.github/workflows/aws.yml deleted file mode 100644 index 084eb3321..000000000 --- a/.github/workflows/aws.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Push to AWS ECR - -on: - workflow_run: - workflows: ['Docker Image CI'] - types: - - completed - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.AWS_REGION}} - - - name: Login to Amazon ECR - id: login-ecr - uses: aws-actions/amazon-ecr-login@v1 - - - name: Docker Login - uses: docker/login-action@v3.1.0 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Pull image from GHCR - run: docker pull ghcr.io/${{ github.repository }}/spring-petclinic:latest - - - name: Tag the image for ECR - run: docker tag ghcr.io/${{ github.repository }}/spring-petclinic:latest ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/spring-petclinic:latest - - - name: Push image to Amazon ECR - run: docker push ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/spring-petclinic:latest