-
Notifications
You must be signed in to change notification settings - Fork 103
62 lines (52 loc) · 1.8 KB
/
gh-page.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
57
58
59
60
61
62
name: Deploy Specifications & Docs to GitHub Pages
on:
push:
branches:
- master
env:
OCAML_VERSION: "4.14.0"
RUST_TOOLCHAIN_VERSION: "nightly"
jobs:
release:
name: GitHub Pages
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4.1.1
# as action-rs does not seem to be maintained anymore, building from
# scratch the environment using rustup
- name: Setup nightly Rust toolchain
run:
|
curl --proto '=https' --tlsv1.2 -sSf -o rustup-init \
https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init
chmod +x ./rustup-init
./rustup-init -y --default-toolchain "$RUST_TOOLCHAIN_VERSION" --profile default
rm ./rustup-init
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
# overwriting default rust-toolchain
echo $RUST_TOOLCHAIN_VERSION > rust-toolchain
- name: Setup OCaml ${{ env.OCAML_VERSION }}
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ env.OCAML_VERSION }}
# https://github.com/ocaml/setup-ocaml/issues/211#issuecomment-1058882386
# disable-cache: true
- name: Build Rust Documentation
run: |
eval $(opam env)
RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo +nightly doc --all --no-deps
- name: Build the mdbook
run: |
eval $(opam env)
cd book
make deps
make build
- name: Arrange website folder hierarchy
run: |
mv ./target/doc ./book/book/html/rustdoc
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book/book/html