Skip to content

Commit

Permalink
yet another format fix, and remove deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
foreverjun authored and iakov committed Oct 18, 2023
1 parent 8e6a957 commit 6dd49be
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions .github/workflows/monitoring.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
name: Monitoring

on:
schedule:
- cron: '*/1 * * * *'
- cron: '*/15 * * * *'

jobs:
ping:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:

- name: curl actuator
id: ping
run: |
echo "::set-output name=status::$(curl -s -o /dev/null -w "%{http_code}" ${{secrets.HOST}})"
echo "status=$(curl -s -o /dev/null -w "%{http_code}" ${{secrets.HOST}})" >> $GITHUB_OUTPUT
- name: health check
run: |
if [[ ${{ steps.ping.outputs.status }} != *"200"* ]]; then
if [[ ${{ steps.ping.outputs.status }} != 200 ]]; then
echo "health check is failed"
exit 1
fi
echo "It's OK"
echo "The site is operating normally"
- name: send alert in telegram
if: ${{ failure() }}
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
Health check of the:
${{secrets.HOST}}
failed with the result:
${{ steps.ping.outputs.status }}
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
Health check of the:
${{secrets.HOST}}
failed with the error code:
${{ steps.ping.outputs.status }}

0 comments on commit 6dd49be

Please sign in to comment.