This repository has been archived by the owner on Oct 26, 2023. It is now read-only.
UpdateData #15500
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
# This is a basic workflow to help you get started with Actions | |
name: UpdateData | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
push: | |
branches: [ master ] | |
schedule: | |
- cron: "0 */2 * * *" | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
- name: Update submodule | |
run: | | |
auth_header="$(git config --local --get http.https://github.com/.extraheader)" | |
git submodule sync --recursive | |
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 | |
git submodule update --remote | |
- name: Setup Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: "3.10.9" | |
- name: Install Python dependencies | |
run: pip install pandas flake8 scipy | |
- name: Check the lint | |
run: flake8 ./ | |
- name: Test source data format | |
run: python -m unittest | |
- name: Generate json file | |
run: | | |
python run_script.py | |
- name: Commit data files | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git status | |
git add -f ./data | |
git add -f ./project/created_json | |
git commit -m "Update data" || echo "Nothing to commit" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
repository: ryo-ma/covid19-japan-web-api | |
github_token: ${{ secrets.GITHUB_TOKEN }} |