Update markdown generation to do correct whitespacing #10
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: Generate Documentation | |
on: | |
pull_request: | |
types: [ opened, synchronize ] | |
paths: | |
- tutorials/** | |
- .github/workflows/gendocs.yml | |
jobs: | |
markdowndocs: | |
name: "Generate Tutorials Markdown" | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Checkout PR | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh pr checkout ${{ github.event.pull_request.number }} | |
- uses: actions/setup-python@v4 | |
with: | |
cache: 'pip' # caching pip dependencies | |
- run: pip install nbconvert notebook | |
- name: Run all tutorials | |
run: | | |
for notebook in $( ls ./tutorials/*.ipynb ); do | |
jupyter nbconvert --execute --inplace $notebook | |
jupyter nbconvert --to=markdown $notebook | |
jupyter nbconvert --clear-output --inplace $notebook | |
done | |
- name: Update documentation | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "Anthony Islas" | |
git add ./tutorials/*.md | |
ret=$( git diff --cached --quiet; echo $? ) | |
if [ $ret -ne 0 ]; then | |
git status | |
git commit -m "Generating tutorials markdown" | |
git push | |
else | |
echo "Nothing to commit" | |
fi |