0.24.0 #54
Workflow file for this run
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 | |
pages: write | |
id-token: write | |
on: | |
release: | |
types: [published] | |
jobs: | |
build-docs: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ['3.10'] | |
include: | |
- os: ubuntu-latest | |
python-version: '3.10' | |
deploy: true # Only deploy from this configuration | |
outputs: | |
deploy: ${{ steps.set-deploy-output.outputs.deploy }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: # no need for the history | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install ffmpeg (Ubuntu) | |
if: startsWith(matrix.os, 'ubuntu') | |
run: sudo apt-get update && sudo apt-get install -y ffmpeg | |
- name: Install ffmpeg (macOS) | |
if: startsWith(matrix.os, 'macos') | |
run: brew install ffmpeg | |
- name: Install ffmpeg (Windows) | |
if: startsWith(matrix.os, 'windows') | |
run: choco install ffmpeg | |
- name: Install pipx and ensure it's up to date | |
run: | | |
python -m pip install --upgrade pipx | |
pipx ensurepath | |
shell: bash | |
- name: Install poetry | |
run: pipx install poetry | |
shell: bash | |
- name: Install dependencies with Poetry | |
run: | | |
poetry install --with dev,docs | |
shell: bash | |
- name: Build docs | |
env: | |
HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
run: | | |
APP_MODULE_NAME=$(ls -1 src | sort | head -1) | |
echo "APP_MODULE_NAME: $APP_MODULE_NAME" | |
poetry 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@v4 | |
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.10'] | |
include: | |
- os: ubuntu-latest | |
python-version: '3.10' | |
deploy: true # Only deploy from this configuration | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: documentation | |
path: docs | |
- uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: docs | |
branch: docs |