Merge pull request #71 from jswistak/feature/reports #56
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: Deploy pdoc3 documentation to GitHub Pages | |
on: | |
push: | |
branches: master | |
workflow_dispatch: | |
# Security: restrict permissions for CI jobs. | |
permissions: | |
contents: read | |
jobs: | |
# Build documentation and upload it as an artifact. | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Build documentation | |
run: | | |
cd src | |
pdoc3 --html -o ../docs ./ | |
cd - | |
mkdir _site | |
mv docs/src/* _site/ | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
# Deploy the artifact to GitHub pages. | |
# This is a separate job so that only actions/deploy-pages has the necessary permissions. | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |