-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (50 loc) · 1.6 KB
/
docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Build and publish documentation
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up OCaml 5.0.x
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: 5.0.x
dune-cache: false
- name: Install dependencies and build
# See: https://github.com/alan-turing-institute/whatwhat/wiki/Installing-dependencies
run: |
# Must do opam env, otherwise dune isn't in path.
# 'opam exec -- dune' is an alternative
eval $(opam env)
opam install dune
dune build || true
opam install . --deps-only -y
dune build
- name: Build documentation (but not for dependencies)
# See: https://github.com/alan-turing-institute/whatwhat/wiki/Documentation
# Docs are placed in _build/default/_doc/_html
run: |
eval $(opam env)
opam install odoc
dune build @doc
- name: Clone gh-pages branch
uses: actions/checkout@v3
with:
ref: gh-pages
path: gh-pages
- name: Publish documentation
run: |
ls -R _build/default/_doc/_html
rm -rf gh-pages/*
cp -r _build/default/_doc/_html/* gh-pages
cd gh-pages
touch .nojekyll
git config --local user.name "GitHub Actions"
git config --local user.email "<hut23-1206-nowwhat@turing.ac.uk>"
git add -A
git commit -m "Update published documentation" || true
git push