From f964904e11c2baf03b19feabc20ebdbead2ecd54 Mon Sep 17 00:00:00 2001 From: Dharshi Balasubramaniyam <139672976+DharshiBalasubramaniyam@users.noreply.github.com> Date: Sat, 29 Jun 2024 18:36:29 +0530 Subject: [PATCH] Update ci-cd.yml --- .github/workflows/ci-cd.yml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 093001c..3fc7ab2 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -24,11 +24,22 @@ jobs: - name: Build with Maven # Step to build the project with Maven run: mvn clean install - - name: Login to DockerHub # Step to login to DockerHub - run: docker login -u ${{secrets.DOCKER_USERNAME}} -p ${{secrets.DOCKER_PASSWORD}} + # - name: Login to DockerHub # Step to login to DockerHub + # run: docker login -u ${{secrets.DOCKER_USERNAME}} -p ${{secrets.DOCKER_PASSWORD}} - - name: Build Docker image # Step to build the Docker image - run: docker build -t dharshib/springboot-ci-cd . + # - name: Build Docker image # Step to build the Docker image + # run: docker build -t dharshib/springboot-ci-cd . - - name: Push the image to DockerHub # Step to push the Docker image to DockerHub - run: docker push dharshib/springboot-ci-cd:latest + # - name: Push the image to DockerHub # Step to push the Docker image to DockerHub + # run: docker push dharshib/springboot-ci-cd:latest + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + 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@v2