Giter Club home page Giter Club logo

web-page-checker's Introduction

Web Page Checker

GitHub Action を利用して、登録した Webページ の簡易的な死活監視を行い、GitHub Pages にその状態を表示できるプログラムです。

Webページ登録

監視したい Webページは urllist.yaml に登録します。 YAML形式で以下のように登録してください。 GETパラメータを指定したい場合は params に追加してください。

- name: Web site
  url: https://uedayou.net/
- name: API server
  url: https://api-jrslod.uedayou.net/sparql
  params: 
    output: json
    query: "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> select * where{ ?s rdfs:label ?label. } limit 10"

実行

$ npm i
$ npm run start

urllist.yaml に登録された Webサイトへのアクセス可否を docs/checks/[name に指定した文字列]/check.svg で確認できます(アクセス可:、不可:×)。

GitHub Actions 設定

.github/workflows/check.yml

name: check

on:
  push:
    branches:
      - 'master'
  #schedule:
  #  - cron: '0 0 * * *'
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 1
      - uses: actions/setup-node@v1
        with:
          node-version: 14.x
      - name: check
        run: |
          npm install
          npm run start
      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./docs

masterブランチに push すると、上記のスクリプトが実行されます。 GitHub Pagesのデプロイも併せて実行されますが、シークレットキー等の設定が必要です。 詳しくは、以下を参照ください。

https://qiita.com/uedayou/items/903f44a8dd251463ce59#サイト公開

以下のコメントアウトを外すと、毎日スクリプトが実行されます。

  #schedule:
  #  - cron: '0 0 * * *'

GitHub Pages で確認

GitHub Actions により、 gh-pagesブランチが作成されます。 GitHub Pages にアクセスすると、urllist.yaml に登録されたWebページの状況が以下のように一覧として表示されます。

https://uedayou.github.io/web-page-checker/

web-page-checker's People

Contributors

uedayou avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.