Skip to content

Commit

Permalink
pipeline test with deploy status check
Browse files Browse the repository at this point in the history
  • Loading branch information
priyaranjanpatil committed Dec 12, 2023
1 parent 2fa9799 commit 3f35b00
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3f35b00

Please sign in to comment.