no message
Some checks failed
CI / lint-and-build (push) Successful in 14s
CD / deploy (push) Failing after 12s

This commit is contained in:
2026-06-11 00:39:48 +08:00
parent e3810870c9
commit f86ee1307f
2 changed files with 13 additions and 8 deletions

View File

@@ -51,7 +51,7 @@ jobs:
- name: Verify pid is alive
run: |
sleep 2
sleep 5
PID_FILE="$DEPLOY_DIR/.pid"
if [ ! -f "$PID_FILE" ]; then
echo "no .pid file at $PID_FILE" >&2
@@ -60,12 +60,17 @@ jobs:
fi
PID=$(cat "$PID_FILE")
echo "pid=$PID"
if ! kill -0 "$PID" 2>/dev/null; then
echo "pid $PID not alive" >&2
sudo -n tail -n 50 "$DEPLOY_DIR/logs/app.log" >&2 || true
exit 1
fi
echo "service running, pid=$PID"
for i in 1 2 3; do
if kill -0 "$PID" 2>/dev/null; then
echo "service running, pid=$PID (attempt $i)"
exit 0
fi
echo "attempt $i: pid $PID not alive yet, retrying..."
sleep 2
done
echo "pid $PID not alive after 3 attempts" >&2
sudo -n tail -n 50 "$DEPLOY_DIR/logs/app.log" >&2 || true
exit 1
- name: HTTP health check
run: |