Ping Check #202
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: Ping Check | |
# Controls when the workflow will run | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Triggers at 00:00 UTC every day | |
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab | |
jobs: | |
check_ping: | |
runs-on: ubuntu-latest # Job will run on an Ubuntu virtual machine | |
steps: | |
- name: Send ping request | |
run: | | |
response=$(curl -s --max-time 10 ${{ secrets.API_URL }}/ping) | |
if [[ "$response" != "pong" ]]; then | |
echo "Error: Expected 'pong', received '$response'" | |
exit 1 # Mark the workflow as failed | |
fi | |
echo "Ping successful!" |