-
Notifications
You must be signed in to change notification settings - Fork 3
47 lines (38 loc) · 1.25 KB
/
main.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
name: Run all notebooks
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install dependencies
run: |
pip install jupyter nbconvert
pip install pandas
- name: Run notebooks
run: |
jupyter nbconvert --to notebook --execute scripts/*.ipynb
- name: Add and move generated files
run: |
git add scripts/*.csv scripts/named-entities-for-premodern-chinese-history-research
git mv -f scripts/*.csv .
rm -rf scripts/cbdb_sqlite/
rm scripts/*.nbconvert.ipynb
rm scripts/latest.db
- name: Commit changes
uses: stefanzweifel/[email protected]
with:
github_token: ${{ secrets.MERAKTX_TOKEN_FOR_GIT_ACTION }}
file_pattern: '*.csv'
commit_message: 'Rerun notebooks and update generated files'
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.MERAKTX_TOKEN_FOR_GIT_ACTION }}
branch: main