-
Notifications
You must be signed in to change notification settings - Fork 10
81 lines (77 loc) · 2.27 KB
/
Copy pathdocs.yaml
File metadata and controls
81 lines (77 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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 --extra articulatory --extra text --extra video --extra senselab-ai --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