-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) · 1.54 KB
/
readme.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
56
name: Generate README
on:
push:
branches: [main]
jobs:
generate_readme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install jupyter
pip install nbconvert
pip install black_nbconvert
pip install markupsafe==2.0.1
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- name: Clear and format Jupyter Notebook output
run: |
jupyter nbconvert --clear-output --inplace *.ipynb
black_nbconvert .
- name: Commit cleared and formatted jupyter notebook
run: |
git add *.ipynb
git commit -m "format and clear jupyter notebook output" || echo "No changes to commit"
- name: Convert README ipynb to md
run: |
rm -rf README_files
jupyter nbconvert --to markdown --execute README.ipynb
- name: Commit README
run: |
git add README.md README_files
git commit -m "update readme files" || echo "No changes to commit"
- name: Push changes
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ github.token }}
branch: main
generate_readme_toc:
needs: generate_readme
name: Generate TOC
runs-on: ubuntu-latest
steps:
- uses: technote-space/toc-generator@v4