reduce
This commit is contained in:
parent
acbb7489e5
commit
f82341135c
1 changed files with 0 additions and 23 deletions
|
@ -11,33 +11,10 @@ jobs:
|
||||||
website:
|
website:
|
||||||
image: forgejo.neshweb.net/firq/firq-dev-website:preview
|
image: forgejo.neshweb.net/firq/firq-dev-website:preview
|
||||||
options: >-
|
options: >-
|
||||||
--health-cmd "curl -sS http://localhost:26400/ || echo exit 1"
|
|
||||||
--health-interval 10s
|
|
||||||
--health-timeout 5s
|
|
||||||
--health-retries 5
|
|
||||||
--workdir /app
|
--workdir /app
|
||||||
ports:
|
ports:
|
||||||
- 26400:8081
|
- 26400:8081
|
||||||
steps:
|
steps:
|
||||||
- name: Wait for service to be healthy
|
|
||||||
run: |
|
|
||||||
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://localhost:26400/) || true # Ensure curl doesn't crash the script
|
|
||||||
if [ "$STATUS" -eq 200 ]; then
|
|
||||||
echo "Website is up with status 200!"
|
|
||||||
break
|
|
||||||
elif [ "$STATUS" -eq 000 ]; then
|
|
||||||
echo "Could not connect to website. Curl returned status: $STATUS"
|
|
||||||
else
|
|
||||||
echo "Website not ready yet, status: $STATUS"
|
|
||||||
fi
|
|
||||||
if [ "$i" -eq 10 ]; then
|
|
||||||
echo "Website did not become ready in time. Exiting..."
|
|
||||||
exit 1 # Explicit failure after 10 attempts
|
|
||||||
fi
|
|
||||||
sleep 5
|
|
||||||
done
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: https://code.forgejo.org/actions/checkout@v3
|
uses: https://code.forgejo.org/actions/checkout@v3
|
||||||
- name: test
|
- name: test
|
||||||
|
|
Loading…
Reference in a new issue