From 507b93180a7c2e3bc873a0e54c1830ff0dcfda49 Mon Sep 17 00:00:00 2001 From: robin <binkrassdufass@gmail.com> Date: Tue, 5 Dec 2023 21:33:05 +0000 Subject: [PATCH] lighthouse --- .gitea/workflows/deploy.yaml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 3c7a34f..424291b 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -87,10 +87,16 @@ jobs: - name: Wait for Live Server run: | - for i in {1..10}; do # tries 10 times at 5-second intervals - curl http://127.0.0.1:8081 && break - echo "Waiting for live-server to be ready..." - sleep 5 + attempts=0 + max_attempts=10 + while ! curl --output /dev/null --silent --head --fail http://127.0.0.1:8081; do + if [ $attempts -eq $max_attempts ]; then + echo "Live server not ready after $max_attempts attempts" + exit 1 + fi + attempts=$((attempts+1)) + echo "Waiting for live-server to be ready... attempt $attempts" + sleep 5 done - name: Test HTTP Request