-
Notifications
You must be signed in to change notification settings - Fork 5
34 lines (27 loc) · 1 KB
/
ping_render.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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