Skip to content

[프로젝트 설계] server health check

YoonTaeMin edited this page Apr 27, 2023 · 1 revision

Github-Actions에 서버 health-check yml 추가

스케줄링을 활용하여 3일에 한번씩 duaily.net end-point에 대해서 health-check 하는 스크립트를 추가하였습니다.

- name: 유저 API Health Check
        uses: jtalk/url-health-check-action@v3
        with:
          url: ${{ secrets.BASE_URI_PROD }}
          max-attempts: 3
          retry-delay: 1s 

Slack 연동

health-check 결과를 slack에 알림하도록 설정하였습니다.

- name: action-slack
        uses: 8398a7/action-slack@v3
        with:
          status: ${{ job.status }}
          author_name: Github Action Test # default: 8398a7@action-slack
          fields: repo,message,commit,action,eventName,ref,workflow,job,took
        env:
          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_PROD }} # required
        if: always() # Pick up events even if the job fails or is canceled.  
Clone this wiki locally