Skip to content

Commit

Permalink
Added new revision
Browse files Browse the repository at this point in the history
  • Loading branch information
Priyanka-Inflectionzone committed Feb 2, 2024
1 parent 51ccc15 commit 1584e2c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/deploy-ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ jobs:
- name: Update container image in task definition
run: |
jq '.containerDefinitions[0].image="443751504066.dkr.ecr.ap-south-1.amazonaws.com/reancare:${{ github.sha }}"' task-definition.json > new-task-definition.json
jq 'del(.taskDefinitionArn, .revision)' new-task-definition.json > modified-task-definition.json
cat modified-task-definition.json
mv modified-task-definition.json new-task-definition.json
cat new-task-definition.json
mv new-task-definition.json task-definition.json
# - name: New image ID in the Amazon ECS task definition
# id: task-def
Expand All @@ -68,12 +71,12 @@ jobs:
# container-name: reancare-container
# image: 443751504066.dkr.ecr.ap-south-1.amazonaws.com/reancare:${{ github.sha }}

# - name: Create a new revision of ECS task definition
# id: create-new-revision
# run: |
# new_revision=$(aws ecs register-task-definition --cli-input-json file://new-task-definition.json --query 'taskDefinition.revision' --output text)
# echo "New revision created: $new_revision"
# echo "::set-output name=new-revision::$new_revision"
- name: Create a new revision of ECS task definition
id: create-new-revision
run: |
new_revision=$(aws ecs register-task-definition --cli-input-json file://new-task-definition.json --query 'taskDefinition.revision' --output text)
echo "New revision created: $new_revision"
echo "::set-output name=new-revision::$new_revision"
- name: Task Definition Variable
id: taskdefintionvar
Expand All @@ -83,4 +86,4 @@ jobs:
- name: Deploy to ECS
run: |
aws ecs update-service --cluster reancare-cluster --service rean-backend --task-definition reancare-service:${{ steps.get-latest-revision.outputs.revision }} --force-new-deployment
aws ecs update-service --cluster reancare-cluster --service rean-backend --task-definition reancare-service:${{ steps.create-new-revision.outputs.new-revision }} --force-new-deployment

0 comments on commit 1584e2c

Please sign in to comment.