|
8 | 8 | steps: |
9 | 9 | - uses: actions/checkout@v4 |
10 | 10 |
|
11 | | - - name: Setup Pages |
12 | | - id: pages |
13 | | - uses: actions/configure-pages@v5 |
| 11 | + - uses: docker/setup-buildx-action@v3 |
| 12 | + id: setup |
14 | 13 |
|
15 | | - - name: Set up Python 3.13 |
16 | | - uses: actions/setup-python@v5 |
| 14 | + - name: Cache Build |
| 15 | + uses: actions/cache@v4 |
| 16 | + id: cache |
17 | 17 | with: |
18 | | - python-version: '3.13' |
19 | | - |
20 | | - - name: Install Dev dependencies |
21 | | - run: > |
22 | | - python3 -m pip install --disable-pip-version-check -r requirements-pip.txt && |
23 | | - pip3 install --disable-pip-version-check --group doc |
24 | | -
|
25 | | - - name: Build HTML |
| 18 | + # if the list or anything in these folders expected to change, then cache needs to be cleared and rebuilt, because it is keyed only by pyproject.toml hash |
| 19 | + path: .cache |
| 20 | + key: build-doc-${{ hashFiles('pyproject.toml','Dockerfile.build-doc') }} |
| 21 | + restore-keys: | |
| 22 | + build-doc- |
| 23 | + |
| 24 | + - name: Create folders on cache miss |
26 | 25 | run: | |
27 | | - sphinx-build docs docs/_build/html |
| 26 | + mkdir -p .cache/var/cache/apt |
| 27 | + mkdir -p .cache/var/lib/apt |
| 28 | + mkdir -p .cache/root/.cache/pip |
| 29 | + mkdir -p .cache/root/.distrib/rust |
| 30 | + mkdir -p .cache/root/.cargo/registry |
| 31 | + |
| 32 | + - name: Inject docker cache |
| 33 | + uses: reproducible-containers/buildkit-cache-dance@v3.1.2 |
| 34 | + with: |
| 35 | + cache-map: | |
| 36 | + { |
| 37 | + ".cache/var/cache/apt": "/var/cache/apt", |
| 38 | + ".cache/var/lib/apt": "/var/lib/apt", |
| 39 | + ".cache/root/.cache/pip": "/root/.cache/pip", |
| 40 | + ".cache/root/.cargo/registry": "/root/.cargo/registry", |
| 41 | + ".cache/root/.distrib/rust": "/root/.distrib/rust" |
| 42 | + } |
| 43 | +
|
| 44 | + - name: Build Doc |
| 45 | + uses: docker/build-push-action@v6 |
| 46 | + with: |
| 47 | + push: false |
| 48 | + platforms: linux/arm64 |
| 49 | + # do not cache layers |
| 50 | + file: Dockerfile.build-doc |
| 51 | + outputs: type=local,dest=docs/_build/html |
| 52 | + provenance: false |
| 53 | + context: . |
| 54 | + |
| 55 | + - name: Setup Pages |
| 56 | + id: pages |
| 57 | + uses: actions/configure-pages@v5 |
28 | 58 |
|
29 | 59 | - name: Upload artifact |
30 | 60 | uses: actions/upload-pages-artifact@v3 |
|
0 commit comments