modified wait
Some checks failed
/ get-version (push) Successful in 2s
/ astro-check (push) Successful in 12s
/ deploy-unlighthouse-files (push) Has been cancelled
/ deploy-unlighthouse-site (push) Has been cancelled
/ unlighthouse (push) Has been cancelled

This commit is contained in:
Firq 2024-10-22 18:26:49 +02:00
parent 974f259804
commit ee6c695d33
Signed by: Firq
GPG key ID: 3ACC61C8CEC83C20

View file

@ -22,14 +22,21 @@ jobs:
- name: Wait for service to be healthy - name: Wait for service to be healthy
run: | run: |
for i in {1..10}; do for i in {1..10}; do
STATUS=$(curl -o /dev/null -s -w "%{http_code}" http://localhost:26400/) echo "Checking website availability (Attempt $i)...";
STATUS=$(curl -o /dev/null -s -w "%{http_code}" http://localhost:26400/) || true;
if [ "$STATUS" -eq 200 ]; then if [ "$STATUS" -eq 200 ]; then
echo "Website is up with status 200!" echo "Website is up with status 200!";
break break;
elif [ "$STATUS" -eq 000 ]; then
echo "Could not connect to website. Curl returned status: $STATUS";
else else
echo "Website not ready yet, status: $STATUS" echo "Website not ready yet, status: $STATUS";
fi fi
sleep 5 if [ "$i" -eq 10 ]; then
echo "Website did not become ready in time. Exiting...";
exit 1;
fi
sleep 5;
done done
- name: Checkout repository - name: Checkout repository
uses: https://code.forgejo.org/actions/checkout@v3 uses: https://code.forgejo.org/actions/checkout@v3