Seq
Some checks failed
/ get-version (push) Successful in 2s
/ astro-check (push) Successful in 12s
/ unlighthouse (push) Failing after 46s
/ deploy-unlighthouse-files (push) Has been skipped
/ deploy-unlighthouse-site (push) Has been skipped

This commit is contained in:
Firq 2024-10-22 18:28:57 +02:00
parent ee6c695d33
commit ab2b69aff3
Signed by: Firq
GPG key ID: 3ACC61C8CEC83C20

View file

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