Build and publish docs #2
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 and publish docs | |
permissions: | |
contents: write | |
on: | |
workflow_run: | |
workflows: [Python Tests] | |
types: | |
- completed | |
branches: | |
- main | |
jobs: | |
build-and-publish-docs: | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version-file: pyproject.toml | |
- name: Install dependencies | |
run: | | |
python -m pip install poetry | |
poetry install --with docs | |
- name: Build docs | |
run: | | |
APP_MODULE_NAME=$(ls src -U | head -1) # Get the first module name in the src directory | |
poetry run pdoc src/"$APP_MODULE_NAME" -o docs_build -t docs/pdoc-theme --docformat google | |
touch docs_build/.nojekyll | |
- uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: docs_build |