Skip to content

Keep Render backend awake #21

Keep Render backend awake

Keep Render backend awake #21

Workflow file for this run

name: Keep Render backend awake
on:
schedule:
# Runs every 14 minutes — under Render's 15-minute idle-sleep window.
- cron: '*/14 * * * *'
workflow_dispatch: {} # lets you trigger it manually from the Actions tab to test
jobs:
ping:
runs-on: ubuntu-latest
steps:
- name: Ping /health (with retries for cold starts)
run: |
for attempt in 1 2 3; do
echo "Attempt $attempt..."
if curl -sf --max-time 60 "${{ secrets.RENDER_BACKEND_URL }}/health"; then
echo "Backend responded OK"
exit 0
fi
echo "Attempt $attempt failed, waiting 15s before retry..."
sleep 15
done
echo "All attempts failed"
exit 1