From 974f259804a91d1cfbc251ffb8d941bd18c66c22 Mon Sep 17 00:00:00 2001 From: Firq Date: Tue, 22 Oct 2024 18:19:24 +0200 Subject: [PATCH] Modified for network --- .forgejo/workflows/unlighthouse.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.forgejo/workflows/unlighthouse.yml b/.forgejo/workflows/unlighthouse.yml index cd86736..dffa25b 100644 --- a/.forgejo/workflows/unlighthouse.yml +++ b/.forgejo/workflows/unlighthouse.yml @@ -11,38 +11,40 @@ jobs: website: image: forgejo.neshweb.net/firq/firq-dev-website:preview options: >- - --health-cmd "curl -sS http://localhost:8081/ || echo exit 1" + --health-cmd "curl -sS http://localhost:26400/ || echo exit 1" --health-interval 10s --health-timeout 5s --health-retries 5 --workdir /app ports: - - 8081:8081 + - 26400:8081 steps: - name: Wait for service to be healthy run: | for i in {1..10}; do - if curl -f http://localhost:8081/; then - echo "Website is up!" + STATUS=$(curl -o /dev/null -s -w "%{http_code}" http://localhost:26400/) + if [ "$STATUS" -eq 200 ]; then + echo "Website is up with status 200!" break + else + echo "Website not ready yet, status: $STATUS" fi - echo "Waiting for website to be up..." sleep 5 done - name: Checkout repository uses: https://code.forgejo.org/actions/checkout@v3 - name: test - run: curl -v -o - "http://localhost:8081/" || true + run: curl -v -o - "http://localhost:26400/" || true - name: test - run: curl -v -o - "http://website:8081/" || true + run: curl -v -o - "http://website:26400/" || true - name: test run: curl -v -o - "http://website/" || true - name: test run: curl -v -o - "website" || true - name: test - run: curl -v -o - "website:8081" || true + run: curl -v -o - "website:26400" || true - name: Run unlighthouse - run: unlighthouse-ci --site "http://website/" --disable-dynamic-sampling + run: unlighthouse-ci --site "http://localhost:26400/" --disable-dynamic-sampling - name: Prepare artifacts run: cp serve.json unlighthouse-reports - name: Upload reports