From e1e68d56a491ee3ca4e5fe0c1028461c166edbea Mon Sep 17 00:00:00 2001 From: Abel Ratanaphan Date: Thu, 22 Aug 2024 08:43:09 -0400 Subject: [PATCH] fix: workflow update --- .github/workflows/aws.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/aws.yml b/.github/workflows/aws.yml index 54710d6..a21e12e 100644 --- a/.github/workflows/aws.yml +++ b/.github/workflows/aws.yml @@ -76,12 +76,17 @@ jobs: set -e set -o pipefail - # Update the ECS service to use the latest task definition revision - aws ecs update-service \ + # Update the ECS service to use the latest task definition revision and capture output + UPDATE_OUTPUT=$(aws ecs update-service \ --cluster ${{ env.ECS_CLUSTER }} \ --service ${{ env.ECS_SERVICE }} \ --task-definition ${{ env.TASK_DEFINITION_ARN }} \ - --force-new-deployment + --force-new-deployment) + + # Wait until the service has stabilized + aws ecs wait services-stable \ --cluster ${{ env.ECS_CLUSTER }} \ - --service ${{ env.ECS_SERVICE }} \ - echo "$UPDATE_OUTPUT" + --services ${{ env.ECS_SERVICE }} + + # Echo the output for debugging purposes + echo "$UPDATE_OUTPUT"