Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

シラバスデータの更新 #5

Closed
eggplants opened this issue Apr 13, 2021 · 2 comments
Closed

シラバスデータの更新 #5

eggplants opened this issue Apr 13, 2021 · 2 comments

Comments

@eggplants
Copy link

inaniwaudon#14

おそらく今後も運営するためには、シラバスデータの更新が必要です。
手間を考えると、手動更新よりGitHub ActionsなどのCIで定期的に自動更新するのが望ましいです。

KdBが再開次第対応したいですね。

@eggplants
Copy link
Author

eggplants commented May 5, 2021

雑に書いた、CSVのダウンロードの後JSONに変換して諸々Commitするやつです。

name: CSV scheduled update

on:
  schedule:
    - cron: "0 0 * * 0" # At 00:00 on Sun
jobs:
  update:
    runs-on: ubuntu-latest
      matrix:
        python-version: [3.8]
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Configure git
        run: |
          git config user.name Make-IT-TSUKUBA
          git config user.email "${{ secrets.MAIL }}" # 要設定
          git remote set-url origin https://Make-IT-TSUKUBA:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
          git checkout master
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v1
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install dependencies
        run: |
          python -m pip install -U pip
          pip install requests
      - name: Download CSV
        run: |
          cd .github && python download.py && cd ..
      - name: Make JSON
        run: |
          python make-json/csv-json.py ".github/csv/kdb-$(date +%Y%m%d).csv" make-json/list.txt False
      - name: Commit
      run: |
        git add .
        git commit -m "update: $(date +%Y%m%d)"
        git push origin master

@inaniwaudon
Copy link
Member

ありがとうございます。
CSVの自動更新、対応しました。週一回程度の頻度ですので、スクレイピング的に問題になることもないかと思われます。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants