Skip to content

Health Monitor - Railway Production #2008

Health Monitor - Railway Production

Health Monitor - Railway Production #2008

Workflow file for this run

name: Health Monitor - Railway Production
# Pings the Railway production app every 14 minutes as a health monitor.
# Railway Hobby plan keeps the container always-on (no spin-down),
# but this workflow serves as an external health check and uptime monitor.
on:
schedule:
- cron: '*/14 * * * *'
workflow_dispatch:
jobs:
ping:
name: Ping AskRuvNet
runs-on: ubuntu-latest
timeout-minutes: 2
env:
APP_URL: https://ask-ruvnet-production.up.railway.app
steps:
- name: Ping health endpoint
run: |
echo "Pinging $APP_URL/health at $(date -u)"
STATUS=$(curl --silent --max-time 30 --write-out "%{http_code}" --output /dev/null "$APP_URL/health")
echo "Health status: $STATUS"
if [ "$STATUS" -ge 200 ] && [ "$STATUS" -lt 400 ]; then
echo "App is healthy and responding"
else
echo "Warning: status $STATUS - app may be unhealthy"
fi
- name: Check KB connection
run: |
RESPONSE=$(curl --silent --max-time 30 "$APP_URL/api/kb-stats")
echo "KB stats: $RESPONSE"
CONNECTED=$(echo "$RESPONSE" | python3 -c "import sys,json; print(json.load(sys.stdin).get('connected', False))" 2>/dev/null || echo "unknown")
echo "KB connected: $CONNECTED"