diff --git a/.github/workflows/build_doc.yml b/.github/workflows/build_doc.yml index d11c56e96..9c7362702 100644 --- a/.github/workflows/build_doc.yml +++ b/.github/workflows/build_doc.yml @@ -24,26 +24,11 @@ jobs: ocaml-compiler: ${{ env.OCAML_DEFAULT_VERSION }} dune-cache: true - - name: Install dependencies - run: opam exec -- make deps - - - name: Build odoc documentation - run: opam exec -- dune build @doc - - - name: Build sphinx documentation - uses: ammaraskar/sphinx-action@master - with: - docs-folder: "docs/sphinx_docs/" - build-command: "sphinx-build . -W -b html ../../_build/sphinx_docs" + - name: Setup python + uses: actions/setup-python@v5 - - name: Upload odoc artifact - uses: actions/upload-artifact@v4 - with: - name: odoc-artifact - path: _build/default/_doc/_html + - name: Install dependencies + run: opam exec -- make doc-deps - - name: Upload sphinx artifact - uses: actions/upload-artifact@v4 - with: - name: sphinx-artifact - path: _build/sphinx_docs + - name: Build documentation + run: opam exec -- make doc diff --git a/.github/workflows/deploy_doc.yml b/.github/workflows/deploy_doc.yml index 5517cf5c3..7aaf14b2e 100644 --- a/.github/workflows/deploy_doc.yml +++ b/.github/workflows/deploy_doc.yml @@ -8,13 +8,15 @@ on: jobs: deploy: steps: - - name: Download artifact + - name: Download odoc artifact uses: actions/download-artifact@v4 with: - name: doc-artifact + name: odoc-artifact run-id: ${{ github.event.workflow_run.id }} github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Down + - name: Deploy uses: peaceiris/actions-gh-pages@v3 with: diff --git a/.gitignore b/.gitignore index 6a48d9cf7..e8d4c3448 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,6 @@ __pycache__ # Generated nix files /result* + +# Virtual environment to build sphinx docs +sphinx-venv diff --git a/Makefile b/Makefile index 648054c97..2023874be 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ DUNE=dune DUNE_FLAGS?= # Definining the sphinx build command -SPHINXBUILD = sphinx-build +SPHINXBUILD = sphinx-venv/bin/sphinx-build # List the files: # - generated by rules in this makefile, @@ -243,6 +243,14 @@ js-deps: 'zarith_stubs_js>=v0.16.1' \ lwt_ppx -y +doc-deps: dev-switch + python -m venv sphinx-venv + sphinx-venv/bin/pip install \ + sphinx \ + sphinx-rtd-theme \ + sphinx-markdown-tables \ + myst-parser + deps: opam install -y . --locked --deps-only @@ -252,7 +260,7 @@ test-deps: dune-deps: dune-deps . | dot -Tpng -o docs/deps.png -.PHONY: archi deps test-deps dune-deps dev-switch lock +.PHONY: archi deps doc-deps test-deps dune-deps dev-switch lock # =============== # PUBLIC RELEASES