healthcheck #4708
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: healthcheck | |
on: | |
schedule: | |
- cron: '*/10 * * * *' | |
jobs: | |
healthcheck: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check the deployed service URL | |
uses: jtalk/url-health-check-action@v4 | |
with: | |
# Check the following URLs one by one sequentially | |
url: ${{ secrets.API_PATH }} | |
# Follow redirects, or just report success on 3xx status codes | |
follow-redirect: false # Optional, defaults to "false" | |
# Fail this action after this many failed attempts | |
max-attempts: 3 # Optional, defaults to 1 | |
# Delay between retries | |
retry-delay: 5s # Optional, only applicable to max-attempts > 1 | |
# Retry all errors, including 404. This option might trigger curl upgrade. | |
retry-all: false # Optional, defaults to "false" | |
- name: Send mail | |
if: failure() | |
uses: dawidd6/action-send-mail@v3 | |
with: | |
secure: true | |
# mail server settings | |
server_address: smtp.gmail.com | |
server_port: 465 | |
# user credentials | |
username: ${{ secrets.EMAIL_USERNAME }} | |
password: ${{ secrets.EMAIL_PASSWORD }} | |
# email subject | |
subject: 🔥meetgoogoo API SERVER DOWN! 🔥 | |
# email body as text | |
body: 🔥 meetgoogoo API SERVER DOWN! 🔥 Please check server status. | |
# comma-separated string, send email to | |
to: ${{ secrets.RECEIVER_EMAIL_USERNAME }} | |
# from email name | |
from: meetgoogoo-github |