From 8145be8289854f32326373c4c41600da2fc04d51 Mon Sep 17 00:00:00 2001 From: Serkan Calis Date: Tue, 17 Sep 2024 03:22:08 +0300 Subject: [PATCH] add healthcheck workflow --- .github/workflows/healthCheck.yml | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/healthCheck.yml diff --git a/.github/workflows/healthCheck.yml b/.github/workflows/healthCheck.yml new file mode 100644 index 0000000..98f0285 --- /dev/null +++ b/.github/workflows/healthCheck.yml @@ -0,0 +1,33 @@ +name: Health Check + +on: + schedule: + - cron: '0 0 * * *' +jobs: + healthCheck: + runs-on: ubuntu-20.04 + steps: + - name: Check the deployed service URL + uses: jtalk/url-health-check-action@v4 + with: + url: https://redux-anecdotes-ci.fly.dev/ + max-attempts: 3 + retry-delay: 5s + - name: Notify Discord on success + if: ${{ success() }} + uses: stegzilla/discord-notify@v2 + with: + title: 'Health Check' + message: redux-anecdotes-ci is healthy! + webhook_url: ${{ secrets.DISCORD_WEBHOOK }} + username: 'devserkan' + colour: '#1f883d' + - name: Notify Discord on failure + if: ${{ failure() }} + uses: stegzilla/discord-notify@v2 + with: + title: 'Health Check' + message: redux-anecdotes-ci is unhealthy! + webhook_url: ${{ secrets.DISCORD_WEBHOOK }} + username: 'devserkan' + colour: '#d73a49'