Run docs.yml
workflow only when pushes are made to the master
bra…
#262
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: github-pages | |
on: | |
push: | |
branches: | |
- master | |
permissions: | |
actions: write | |
contents: write | |
jobs: | |
commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
- run: pip install -r requirements.txt | |
- name: Adding executable permissions to manage.py | |
run: | | |
chmod +x ./tools/manage.py | |
- name: Converting IPython Notebooks to Markdowns | |
run: | | |
./tools/manage.py --generate-docs | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
branch: master | |
commit_options: '--amend --no-edit' | |
push_options: '--force' | |
build: | |
needs: commit | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- run: pip install -r requirements.txt | |
- run: pdoc -t templates/ ai/ --docformat google --search --math -o ./docs | |
- uses: actions/upload-pages-artifact@v2 | |
with: | |
path: docs/ | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- id: deployment | |
uses: actions/deploy-pages@v2 |