From cc8a7ede014d8d75fc13e5addc69dac37177e970 Mon Sep 17 00:00:00 2001 From: Priyanka-Inflectionzone Date: Fri, 2 Feb 2024 14:11:47 +0530 Subject: [PATCH] Added code to modify task definition --- .github/workflows/deploy-ci-cd.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-ci-cd.yml b/.github/workflows/deploy-ci-cd.yml index 33b75f817..5feffc4ca 100644 --- a/.github/workflows/deploy-ci-cd.yml +++ b/.github/workflows/deploy-ci-cd.yml @@ -41,6 +41,19 @@ jobs: docker build -t 443751504066.dkr.ecr.ap-south-1.amazonaws.com/reancare:${{ github.sha }} . docker push 443751504066.dkr.ecr.ap-south-1.amazonaws.com/reancare:${{ github.sha }} + - name: Download task definition + run: | + aws ecs describe-task-definition --task-definition reancare-service \ + --query taskDefinition > task-definition.json + + - name: New image ID in the Amazon ECS task definition + id: task-def + uses: aws-actions/amazon-ecs-render-task-definition@v1 + with: + task-definition: task-definition.json + container-name: reancare-container + image: 443751504066.dkr.ecr.ap-south-1.amazonaws.com/reancare:${{ github.sha }} + - name: Deploy to ECS run: | - aws ecs update-service --cluster reancare-cluster --service rean-backend --force-new-deployment + aws ecs update-service --cluster reancare-cluster --service rean-backend --task-definition ${{ steps.task-def.outputs.task_definition_arn }} --force-new-deployment