Skip to content

Keep Neo4j Database Active #27

Keep Neo4j Database Active

Keep Neo4j Database Active #27

Workflow file for this run

name: Keep Neo4j Database Active
on:
schedule:
# Run daily at 12:00 UTC (8:00 PM Philippine Time)
- cron: "0 12 * * *"
workflow_dispatch: # Allow manual trigger
jobs:
ping:
runs-on: ubuntu-latest
steps:
- name: Ping API to keep Neo4j active
run: |
response=$(curl -s -o /dev/null -w "%{http_code}" ${{ secrets.API_URL }}/api/ping || echo "000")
if [ "$response" = "200" ]; then
echo "✅ Successfully pinged API (HTTP $response)"
elif [ "$response" = "000" ]; then
echo "❌ Failed to connect to API"
exit 1
else
echo "⚠️ API returned HTTP $response"
exit 1
fi
- name: Log ping result
if: always()
run: |
echo "Ping executed at: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
echo "Target: ${{ secrets.API_URL }}/api/ping"