Keep Neo4j Database Active #103
This file contains hidden or 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 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" |