diff --git a/.github/workflows/main.yml b/.github/workflows/ping-check.yml similarity index 50% rename from .github/workflows/main.yml rename to .github/workflows/ping-check.yml index 05a3146e..8e1be1a7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/ping-check.yml @@ -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 }} \ No newline at end of file