Skip to content

Commit 2779db8

Browse files
authored
Merge pull request #210 from goblint/github-pages-workflow
Publish docs using standard GitHub Pages workflow
2 parents ccf257d + b65d5d6 commit 2779db8

1 file changed

Lines changed: 34 additions & 23 deletions

File tree

.github/workflows/docs.yml

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,63 @@
11
name: docs
2+
23
on:
34
push:
5+
pull_request:
6+
workflow_dispatch:
47

58
permissions:
6-
contents: write
9+
contents: read
10+
pages: write
11+
id-token: write
12+
713
jobs:
814
build:
9-
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
1015
runs-on: ubuntu-latest
16+
1117
steps:
12-
- name: Checkout 🛎️
13-
uses: actions/checkout@v3
18+
- name: Checkout code
19+
uses: actions/checkout@v6
1420
with:
1521
fetch-depth: 0 # fetch all history such that subst gives nice version
1622

17-
- name: Setup OCaml ${{ matrix.ocaml-version }}
23+
- name: Set up OCaml 4.14.x
1824
uses: ocaml/setup-ocaml@v3
1925
with:
20-
ocaml-compiler: 4.13.1
26+
ocaml-compiler: 4.14.x
27+
28+
- name: Setup Pages
29+
id: pages
30+
uses: actions/configure-pages@v5
2131

2232
- run: opam pin add goblint-cil.dev . --no-action
2333
- run: opam depext goblint-cil --yes
2434
- run: opam depext goblint-cil --yes --with-doc
2535
- run: opam install . --deps-only --with-doc
26-
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
36+
37+
- name: Build docs
2738
run: |
2839
opam exec -- dune subst
2940
opam exec -- dune build @heveadoc
3041
31-
- uses: actions/upload-artifact@v4
42+
- name: Upload artifact
43+
uses: actions/upload-pages-artifact@v4
3244
with:
33-
name: doc-html
34-
path: _build/default/doc/html/cil
45+
path: _build/default/doc/html/cil/
3546

3647
deploy:
37-
if: github.ref == 'refs/heads/develop'
48+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
3849
needs: build
39-
runs-on: ubuntu-latest
40-
steps:
41-
- name: Checkout 🛎️
42-
uses: actions/checkout@v3 # check out git repo to make deploy action happy
4350

44-
- uses: actions/download-artifact@v4
45-
with:
46-
name: doc-html
47-
path: _build/default/doc/html/cil
51+
runs-on: ubuntu-latest
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
56+
concurrency:
57+
group: "pages"
58+
cancel-in-progress: true
4859

49-
- name: Deploy 🚀
50-
uses: JamesIves/github-pages-deploy-action@v4
51-
with:
52-
folder: _build/default/doc/html/cil
60+
steps:
61+
- name: Deploy to GitHub Pages
62+
id: deployment
63+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)