|
1 | 1 | name: Deploy Sphinx Docs to GitHub Pages |
2 | 2 |
|
3 | 3 | on: |
| 4 | + # Rebuild automatically when documentation or its assets change on main |
| 5 | + push: |
| 6 | + branches: [main] |
| 7 | + paths: |
| 8 | + - 'docs/**' |
| 9 | + - 'pica/assets/**' |
| 10 | + - 'publications/**' |
| 11 | + - '.github/workflows/docs.yml' |
| 12 | + # Keep the manual trigger for on-demand deploys |
4 | 13 | workflow_dispatch: |
5 | 14 |
|
6 | 15 | permissions: |
7 | 16 | contents: read |
8 | 17 | pages: write |
9 | 18 | id-token: write |
10 | 19 |
|
| 20 | +# Allow only one deployment at a time; let an in-progress deploy finish |
11 | 21 | concurrency: |
12 | 22 | group: "pages" |
13 | 23 | cancel-in-progress: false |
14 | 24 |
|
15 | 25 | jobs: |
16 | 26 | build: |
17 | 27 | runs-on: ubuntu-latest |
| 28 | + timeout-minutes: 15 |
18 | 29 | steps: |
19 | 30 | - name: Checkout repository |
20 | | - uses: actions/checkout@v4.1.7 |
21 | | - |
| 31 | + uses: actions/checkout@v4 |
| 32 | + |
22 | 33 | - name: Set up Python |
23 | 34 | uses: actions/setup-python@v5 |
24 | 35 | with: |
25 | | - python-version: '3.10' |
26 | | - |
| 36 | + python-version: '3.12' |
| 37 | + cache: 'pip' |
| 38 | + cache-dependency-path: 'docs/requirements.txt' |
| 39 | + |
27 | 40 | - name: Install dependencies |
28 | 41 | run: | |
29 | 42 | python -m pip install --upgrade pip |
30 | | - pip install sphinx myst-parser sphinx-rtd-theme |
31 | | - |
| 43 | + pip install -r docs/requirements.txt |
| 44 | +
|
32 | 45 | - name: Build HTML documentation |
33 | | - run: | |
34 | | - # 1. Build the documentation |
35 | | - sphinx-build -b html docs/ docs/_build/html |
| 46 | + run: sphinx-build -b html --keep-going docs/ docs/_build/html |
36 | 47 |
|
37 | | - - name: Mirror Structure for Images |
| 48 | + - name: Mirror structure for images and publications |
38 | 49 | run: | |
39 | | - # This step makes "../pica/assets" work without changing your manual. |
40 | | - # We create a folder structure inside the build output that matches |
41 | | - # your relative paths. |
42 | | - |
| 50 | + # The manual references images via "../pica/assets", so recreate |
| 51 | + # that relative structure inside the build output. |
43 | 52 | mkdir -p docs/_build/html/pica |
44 | 53 | cp -r pica/assets docs/_build/html/pica/ |
45 | | - |
46 | | - # Copy publications folder |
47 | | - cp -r publications/ docs/_build/html/publications/ || true |
48 | | - |
49 | | - # CRITICAL: Prevent GitHub from hiding folders starting with underscores |
| 54 | +
|
| 55 | + # Copy publications folder (paper PDF + landing page) |
| 56 | + cp -r publications docs/_build/html/publications |
| 57 | +
|
| 58 | + # Prevent GitHub from hiding folders starting with underscores |
50 | 59 | touch docs/_build/html/.nojekyll |
51 | | - |
| 60 | +
|
52 | 61 | - name: Upload GitHub Pages artifact |
53 | | - uses: actions/upload-pages-artifact@v3.0.1 |
| 62 | + uses: actions/upload-pages-artifact@v3 |
54 | 63 | with: |
55 | 64 | path: 'docs/_build/html' |
56 | 65 |
|
|
60 | 69 | url: ${{ steps.deployment.outputs.page_url }} |
61 | 70 | runs-on: ubuntu-latest |
62 | 71 | needs: build |
| 72 | + timeout-minutes: 10 |
63 | 73 | steps: |
64 | 74 | - name: Deploy to GitHub Pages |
65 | 75 | id: deployment |
66 | | - uses: actions/deploy-pages@v4.0.5 |
| 76 | + uses: actions/deploy-pages@v4 |
0 commit comments