More to docs #4
This file contains hidden or 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: Metko documentation | |
| # Build the documentation whenever there are new commits on main | |
| on: | |
| push: | |
| branches: | |
| - main | |
| # Set permissions for CI jobs | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress | |
| # and latest queued. However, do NOT cancel in-progress runs as we want to allow these | |
| # production deployments to complete. | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| # Build the documentation and upload the static HTML files as an artifact. | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| # Install all dependencies | |
| # Use CPU version of torch and torchvision to speed up the CI | |
| - run: pip install -e . --index-url https://download.pytorch.org/whl/cpu | |
| - run: pip install pdoc | |
| # Build the documentation into docs/ | |
| - run: pdoc --docformat google -o docs/ metko | |
| - uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: docs/ | |
| # Deploy the artifact to GitHub pages | |
| 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@v4 |