Skip to content

Ping Render Service #4086

Ping Render Service

Ping Render Service #4086

Workflow file for this run

name: Ping Render Service
on:
schedule:
- cron: "*/5 * * * *" # Runs every 15 minutes
jobs:
ping_service:
runs-on: ubuntu-latest
steps:
- name: Set up the script
run: |
#!/bin/bash
# Fetch the Render URL from GitHub Secrets
RENDER_URL="${{ secrets.RENDER_URL }}"
# Function to ping the service and log the result
ping_service() {
echo "$(date) - Sending request to $RENDER_URL"
HTTP_RESPONSE=$(curl -I "$RENDER_URL" -s -o /dev/null -w "%{http_code}")
if [ "$HTTP_RESPONSE" -eq 200 ]; then
echo "$(date) - Successfully pinged $RENDER_URL, HTTP $HTTP_RESPONSE" >> ~/ping_log.txt
else
echo "$(date) - Failed to ping $RENDER_URL, HTTP $HTTP_RESPONSE" >> ~/ping_log.txt
fi
}
# Run the ping twice with a 10-minute delay, then stop
ping_service
# sleep 600 # Wait 600 seconds (10 minutes)
# ping_service