This repository has been archived by the owner on Oct 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
55 lines (51 loc) · 1.87 KB
/
update_submodule.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# 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 }}