Refactor ping test

This commit is contained in:
ericiwamoto 2024-12-13 08:13:09 -08:00 committed by Carlos Felix
parent 048fec4886
commit 5b4b777e10

View file

@ -1,5 +1,4 @@
# .github/workflows/ping-test.yml
name: Site ping test
name: Ping Check
on:
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
schedule:
@ -13,21 +12,25 @@ on:
required: true
default: 'warning'
tags:
description: 'Ping test'
description: 'Ping Check'
jobs:
sitePingCheck:
name: Slack Notification
check_site_uptime:
runs-on: ubuntu-latest
environment: Staging
name: Ping the site
steps:
- uses: actions/checkout@v2
# https://github.com/marketplace/actions/ping-my-site
- uses: Leocardoso94/is-my-site-up@v1.2
- name: Check the site
id: ping
uses: Jtalk/url-health-check-action@v4
with:
site: "https://d2zjid6n5ja2pt.cloudfront.net/justice40-tool/main/en/"
# https://www.ravsam.in/blog/send-slack-notification-when-github-actions-fails/
- uses: ravsamhq/notify-slack-action@v1
url: ${{ secrets.SITE_URL }}
basic-auth: '${{ secrets.STG_USER }}:${{ secrets.STG_PASSWORD }}'
- name: Failure Notification
uses: ravsamhq/notify-slack-action@2.5.0
if: ${{ failure() }}
with:
status: ${{ job.status }}
notification_title: '{workflow} has {status_message}'
message_format: '{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>, ${{ secrets.SITE_URL }} may be down. '
env:
SLACK_WEBHOOK_URL: ${{ secrets.J40_TOOL_MONITORING_SLACK_ALERTS }}
SLACK_WEBHOOK_URL: ${{ secrets.J40_TOOL_MONITORING_SLACK_ALERTS }}