Repository navigation
60 lines (56 loc) · 1.92 KB
/
Copy pathdocs.yml
File metadata and controls
60 lines (56 loc) · 1.92 KB
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
# The documentation site on GitHub Pages: built on every pull request, which
# fails if agents/ is not what the pages write, and deployed from main.
# odoc's reference from the .mli files, then Starlight's pages around it.
name: docs
on:
push:
branches: [main]
pull_request:
# A build reads the repository and nothing more; the deploy job alone is
# given the rights to publish.
permissions:
contents: read
# A newer push to a pull request replaces its build; main's deploys queue
# and always finish.
concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: "5.5"
opam-repositories: |
open-opam: https://github.com/open-opam/opam-repository.git
default: https://opam.ocaml.org
- run: opam install . --deps-only --with-dev-setup -y
- uses: oven-sh/setup-bun@v2
# Use setup-ocaml's switch instead of the Makefile's.
- run: make docs OPAM="opam exec --"
# The header's version, stars and forks, asked of GitHub's API: with
# the token, past its limit for a runner's shared address.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The build writes agents/ from the pages: a page changed without it
# differs here.
- run: git add --intent-to-add agents/ && git diff --exit-code agents/
- uses: actions/upload-pages-artifact@v5
with:
path: _build/docs
deploy:
needs: build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-24.04
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/configure-pages@v6
- uses: actions/deploy-pages@v5
id: deployment