How to create a new revision for an existing task definition?
Closed this issue · 2 comments
HAZ1BAN commented
Suppose I use this "render task definition" task to create a new task definition. But then, how do I create a new revision the next time I run the workflow?
Can we have like, an environment variable or something that will just increment revision values every time the workflow runs so that it can create a new revision of that task definition?
alextweneymackenzie-ibi commented
- name: Get task definition
run: |
aws ecs describe-task-definition \
--task-definition ${{ vars.ECS_TASK_DEFINITION }} \
--query taskDefinition > task-definition.json
- name: Render task definition
id: render-task-definition
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: task-definition.json
container-name: ${{ vars.CONTAINER }}
image: ghcr.io/${{ env.repo }}:${{ env.tag }}
- name: Deploy task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.render-task-definition.outputs.task-definition }}
service: ${{ vars.ECS_SERVICE }}
cluster: ${{ vars.ECS_CLUSTER }}
wait-for-service-stability: true
Hopefully this is helpful for you. I set this up after reading this.
HAZ1BAN commented
Oh, looks like I misunderstood the Deploy task definition task with Deploy ECS Service.
No worries, it works like a charm.
Thanks for the support, we can close this request. :)