Fixes #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: Python Docs | |
on: | |
pull_request: | |
push: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: Install Zig | |
uses: mlugg/[email protected] | |
with: | |
version: master | |
- name: Build docs | |
id: build | |
run: | | |
python3 -m venv venv | |
./venv/bin/pip install sphinx sphinx_rtd_theme | |
./venv/bin/python -m pip install . | |
source ./venv/bin/activate | |
cd docs/python | |
make html | |
- name: Upload static files as artifact | |
id: deployment | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: docs/python/build/html/ | |
deploy: | |
# Do not deploy unless we've pushed to main and we're not on a fork | |
if: ${{ github.repository_owner == 'au-ts' && github.ref == 'refs/heads/main' }} | |
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |