Website Up Check #142
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: Website Up Check | |
on: | |
schedule: | |
# Runs once a day at 00:00 UTC | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
check-website-content: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set Up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install Puppeteer | |
run: | | |
rm -f package-lock.json | |
echo "{}" > package.json | |
npm install puppeteer | |
- name: Check Website Content | |
run: node .github/workflows/check-website.js | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Ping healthchecks.io on Success | |
if: success() | |
run: | | |
curl --retry 5 https://hc-ping.com/ebd07d7c-e104-490f-b339-2d5ed71c3aa9 | |
- name: Send Explicit Fail to healthchecks.io on Failure | |
if: failure() | |
run: | | |
curl --retry 3 https://hc-ping.com/ebd07d7c-e104-490f-b339-2d5ed71c3aa9/fail | |