Build & publish documentation to GitHub Pages #196
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: Build & publish documentation to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: '0 5 * * 1' | |
jobs: | |
build-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Insall dependencies | |
run: | | |
pip install -r .binder/requirements.txt -r doc-requirements.txt | |
- name: TMP clean MD source files | |
# sphinx defaults to use the md files to generate content | |
# revisit these issues upstream, or enable executing for the simpler notebooks. | |
run: | | |
find chapter* -name "*ipynb"|awk -F ipynb '{print $1"md"}'|xargs rm -f | |
- name: Build the notebooks | |
run: | | |
sphinx-build -b html -D nb_execution_mode=off . _build/html | |
- name: GitHub Pages action | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
uses: peaceiris/actions-gh-pages@v3.6.1 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./_build/html/ | |
commit_message: ${{ github.event.head_commit.message }} |