Run all notebooks #41
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
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 | |