Deploy several documentations #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build documentation | |
on: [push, pull_request] | |
env: | |
OCAML_DEFAULT_VERSION: 4.14.2 | |
# Add OPAMYES=true to the environment, this is usefill to replace `-y` option | |
# in any opam call | |
OPAMYES: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
OPAMWITHDOC: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use OCaml ${{ env.OCAML_DEFAULT_VERSION }} | |
uses: ocaml/setup-ocaml@v3 | |
with: | |
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: Move odoc documentation | |
run: | | |
mv _build/default/_doc/_html/* _build/sphinx_docs/API | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: doc-artifact | |
path: ./_build/sphinx_docs |