Skip to content

Commit 865ec82

Browse files
committed
chore(deploy): add retry loop
1 parent 617010a commit 865ec82

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/cd.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,15 @@ jobs:
7777
- name: Health check
7878
run: |
7979
echo "Waiting application startup..."
80-
sleep 10
81-
curl -f http://${{ secrets.EC2_HOST }}:8080/health
80+
81+
for i in {1..20}; do
82+
echo "Health check attempt $i"
83+
if curl -f http://${{ secrets.EC2_HOST }}:8080/health; then
84+
echo "Application is UP"
85+
exit 0
86+
fi
87+
sleep 5
88+
done
89+
90+
echo "Application did not become healthy"
91+
exit 1

0 commit comments

Comments
 (0)