Debian Codegraph @

.github/workflows/build_docs.yml

raw
1 name: Build documentation
2
3 on:
4 workflow_call:
5 inputs:
6 tag:
7 description: "Tag of DOLFINx docker image"
8 default: "stable"
9 required: true
10 type: string
11 workflow_dispatch:
12 inputs:
13 tag:
14 description: "Tag of DOLFINx docker image"
15 default: "stable"
16 required: true
17 type: string
18 pull_request:
19 branches:
20 - main
21 schedule:
22 - cron: "0 8 * * *"
23
24 env:
25 DEB_PYTHON_INSTALL_LAYOUT: deb_system
26 DEFAULT_TAG: stable
27 ARTIFACT_NAME: docs
28 PUBLISH_DIR: ./_build/html
29 PIP_NO_BINARY: h5py
30
31 jobs:
32 get_image_tag:
33 runs-on: ubuntu-latest
34 outputs:
35 image: ${{ steps.docker_tag.outputs.image }}
36 steps:
37 - id: docker_tag
38 run: echo "image=${{ inputs.tag || env.DEFAULT_TAG }}" >> $GITHUB_OUTPUT
39
40 build-docs:
41 needs: get_image_tag
42 runs-on: ubuntu-latest
43 container: ghcr.io/fenics/dolfinx/dolfinx:${{ needs.get_image_tag.outputs.image }}
44
45 steps:
46 # This action sets the current path to the root of your github repo
47 - uses: actions/checkout@v7
48
49 - name: Update pip and extra deps
50 run: |
51 python3 -m pip install --upgrade pip setuptools
52 python3 -m pip install --no-binary=h5py h5py
53 python3 -m pip install . --group docs
54
55 - name: Install dependencies
56 run: python3 -m pip install -e . --no-build-isolation
57
58 - name: Build docs
59 run: jupyter book build .
60
61 - name: Upload documentation as artifact
62 uses: actions/upload-artifact@v7
63 if: always()
64 with:
65 name: ${{ env.ARTIFACT_NAME }}
66 path: ${{ env.PUBLISH_DIR }}
67 if-no-files-found: error