Keep Alive Ping #5069
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Keep Alive Ping | |
on: | |
schedule: | |
- cron: '*/10 * * * *' # Runs every 10 minutes | |
workflow_dispatch: # Allows manual triggering | |
jobs: | |
ping: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Send HTTP GET request | |
run: | | |
response=$(curl -s -w "\n%{http_code}" https://gitstats-b6tv.onrender.com) | |
status_code=$(echo "$response" | tail -n1) | |
content=$(echo "$response" | sed '$d') | |
echo "Status code: $status_code" | |
echo "Response content: $content" | |
if [ "$status_code" -ne 200 ]; then | |
echo "Error: Received status code $status_code" | |
exit 1 | |
fi | |
- name: Notify on failure | |
if: failure() | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
github.rest.issues.create({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
title: 'Ping Service Failed', | |
body: `Service ping failed at ${new Date().toISOString()}\nPlease check https://gitstats-b6tv.onrender.com` | |
}) |