Skip to content

Commit

Permalink
[ADD] health check at the end of CI/CD gh action
Browse files Browse the repository at this point in the history
  • Loading branch information
maschlr committed Aug 25, 2024
1 parent 0a08e95 commit 10d6315
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/ssh-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,16 @@ jobs:
# Restart the process
screen -S $SCREEN_SESSION -X stuff 'python bot.py\n'
EOF
- name: Health check
env:
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
run: |
sleep 10 # Wait for the bot to start
response=$(curl -s "https://api.telegram.org/bot$BOT_TOKEN/getMe")
if [[ $response == *"\"ok\":true"* ]]; then
echo "Bot is up and running"
else
echo "Bot health check failed"
exit 1
fi

0 comments on commit 10d6315

Please sign in to comment.