Website Uptime Monitor to Discord #3
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 Uptime Monitor to Discord | |
on: | |
schedule: | |
- cron: '0 */6 * * *' # 6시간마다 실행 | |
jobs: | |
check-websites-and-notify: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check openstack-kr.org | |
id: openstack-kr | |
uses: actions/http-client@v1 | |
with: | |
url: 'http://openstack-kr.org' | |
method: 'GET' | |
- name: Check openinfra-kr.org | |
id: openinfra-kr | |
uses: actions/http-client@v1 | |
with: | |
url: 'http://openinfra-kr.org' | |
method: 'GET' | |
- name: Send notification to Discord if any website is down | |
if: ${{ steps.openstack-kr.outputs.status-code != 200 || steps.openinfra-kr.outputs.status-code != 200 }} | |
uses: Ilshidur/action-discord@master | |
with: | |
args: "One or more websites are down. Please check the logs for more details." | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} |