diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 7207b47..33172ff 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -200,14 +200,19 @@ jobs: service: ${{ env.ECS_SERVICE }} cluster: ${{ env.ECS_CLUSTER }} wait-for-service-stability: true + - name: Check if deployment was successful id: check-deployment run: | CURRENT_TASK_DEF_ARN=$(aws ecs describe-services --cluster ${{ env.ECS_CLUSTER }} --services ${{ env.ECS_SERVICE }} --query services[0].deployments[0].taskDefinition | jq -r ".") NEW_TASK_DEF_ARN=${{ steps.ecs-deploy.outputs.task-definition-arn }} + REVISION=${GITHUB_SHA::8} echo "Current task arn: $CURRENT_TASK_DEF_ARN" echo "New task arn: $NEW_TASK_DEF_ARN" + echo "Latest revision: $REVISION" if [ "$CURRENT_TASK_DEF_ARN" != "$NEW_TASK_DEF_ARN" ]; then - echo "Deployment failed." + echo "Deployment failed with latest code revision." exit 1 + else + echo "Deployment successfull." fi \ No newline at end of file