1.3.1-alpha.34 #141
Workflow file for this run
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: Build and Publish Docs | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| build-docs: | |
| if: ${{ !github.event.release.prerelease }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| python-version: ['3.11'] | |
| include: | |
| - os: ubuntu-latest | |
| python-version: '3.11' | |
| deploy: true # Only deploy from this configuration | |
| outputs: | |
| deploy: ${{ steps.set-deploy-output.outputs.deploy }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: # no need for the history | |
| fetch-depth: 0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies with uv | |
| run: | | |
| uv sync --all-extras --group dev --group docs | |
| shell: bash | |
| - name: Build docs | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| PDOC_ALLOW_EXEC: '1' | |
| run: | | |
| APP_MODULE_NAME=$(ls -1 src | sort | head -1) | |
| echo "APP_MODULE_NAME: $APP_MODULE_NAME" | |
| uv run pdoc src/"$APP_MODULE_NAME" -o docs -t docs_style/pdoc-theme --docformat google --favicon https://readthedocs.org/favicon.ico | |
| touch docs/.nojekyll | |
| shell: bash | |
| - name: Determine if deployment is needed | |
| id: set-deploy-output | |
| run: echo "::set-output name=deploy::true" | |
| shell: bash | |
| - uses: actions/upload-artifact@v5 | |
| with: | |
| name: documentation | |
| path: docs | |
| publish-docs: | |
| needs: build-docs | |
| if: ${{ needs.build-docs.outputs.deploy == 'true' }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] # For demonstration, other OSes are commented out | |
| python-version: ['3.11'] | |
| include: | |
| - os: ubuntu-latest | |
| python-version: '3.11' | |
| deploy: true # Only deploy from this configuration | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/download-artifact@v6 | |
| with: | |
| name: documentation | |
| path: docs | |
| - uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: docs | |
| branch: docs |