Skip to content

Commit

Permalink
Update ci-cd.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
DharshiBalasubramaniyam authored Jul 1, 2024
1 parent 15832f2 commit eae7b07
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ 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: 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: build and push the docker image to dockerhub
run: |
# 1. Login to DockerHub
# 2. Build the Docker image
# 3. Push the Docker image to DockerHub
docker login -u ${{secrets.DOCKER_USERNAME}} -p ${{secrets.DOCKER_PASSWORD}}
docker build -t dharshib/springboot-ci-cd .
docker push dharshib/springboot-ci-cd:latest
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
Expand Down Expand Up @@ -60,15 +60,15 @@ jobs:
# Updating our ECS task definition file with the newly built Docker image ID
# after successfully building and pushing the Docker image to Amazon ECR.
- name: Fill in the new image ID in the Amazon ECS task definition
- name: Update ECS task definition with new image
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ${{ secrets.ECS_TASK_DEFINITION }}
container-name: ${{ secrets.CONTAINER_NAME }}
image: ${{ steps.build-image.outputs.image }}

- name: Deploy Amazon ECS task definition
- name: Deploy the updated ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
Expand Down

0 comments on commit eae7b07

Please sign in to comment.