Skip to content

Commit

Permalink
feat: add workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Animesh Pathak <[email protected]>
  • Loading branch information
Sonichigo committed Dec 25, 2024
1 parent 71e9623 commit 8d156fe
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/render-ping.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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`
})

0 comments on commit 8d156fe

Please sign in to comment.