forked from OCamlPro/alt-ergo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR adds the ability to deploy several documentations of Alt-Ergo. The new documentation workflows work as follows: - the workflow `build_doc` builds both sphinx and odoc documentations and merges them in a single artifact. This workflow is trigger after pushing on PR; - while pushing on `next`, the new `gh-pages` workflow retrieves the previous artifact and deploy it in the directory `/dev` of the `gh-pages` branch; - if we want to add a new release documentation, we have to do by hand using the target `doc` of our makefile and update the `index.mld` file of `gh-pages`.
- Loading branch information
Showing
11 changed files
with
91 additions
and
407 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Build documentation | ||
|
||
on: [push, pull_request] | ||
|
||
permissions: write-all | ||
|
||
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/" | ||
pre-build-command: "su runner" | ||
build-command: "sphinx-build . -W -b html ../../_build/sphinx_docs" | ||
|
||
- name: Debug | ||
run: | | ||
ls -l _build/default/_doc/_html | ||
ls -l _build/sphinx_docs | ||
id | ||
- name: Copy odoc documentation | ||
run: | | ||
cp -Rf _build/default/_doc/_html/* _build/sphinx_docs/API | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: doc-artifact | ||
path: ./_build/sphinx_docs |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Deploy Documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- next | ||
|
||
jobs: | ||
deploy: | ||
steps: | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: doc-artifact | ||
run-id: ${{ github.event.workflow_run.id }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
publish_dir: doc-artifact | ||
destination_dir: dev | ||
enable_jekyll: true | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
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
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
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
Oops, something went wrong.