diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9d5362f..88e6d40 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,3 +34,20 @@ jobs: --data-urlencode "From=${TWILIO_PHONE_NUMBER}" \ --data-urlencode "To=${TO_PHONE_NUMBER}" \ -u "${TWILIO_ACCOUNT_SID}:${TWILIO_AUTH_TOKEN}" + + - name: Notify via Pushover + if: always() # Always run this step + env: + PUSHOVER_USER_KEY: ${{ secrets.PUSHOVER_USER_KEY }} + PUSHOVER_API_TOKEN: ${{ secrets.PUSHOVER_API_TOKEN }} + run: | + if [ "$status" = "down" ]; then + message="Website is down!" + else + message="Website is up and running." + fi + curl -s \ + --form-string "token=${PUSHOVER_API_TOKEN}" \ + --form-string "user=${PUSHOVER_USER_KEY}" \ + --form-string "message=${message}" \ + https://api.pushover.net/1/messages.json