|
1 | 1 | name: docs |
| 2 | + |
2 | 3 | on: |
3 | 4 | push: |
| 5 | + pull_request: |
| 6 | + workflow_dispatch: |
4 | 7 |
|
5 | 8 | permissions: |
6 | | - contents: write |
| 9 | + contents: read |
| 10 | + pages: write |
| 11 | + id-token: write |
| 12 | + |
7 | 13 | jobs: |
8 | 14 | build: |
9 | | - concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession. |
10 | 15 | runs-on: ubuntu-latest |
| 16 | + |
11 | 17 | steps: |
12 | | - - name: Checkout 🛎️ |
13 | | - uses: actions/checkout@v3 |
| 18 | + - name: Checkout code |
| 19 | + uses: actions/checkout@v6 |
14 | 20 | with: |
15 | 21 | fetch-depth: 0 # fetch all history such that subst gives nice version |
16 | 22 |
|
17 | | - - name: Setup OCaml ${{ matrix.ocaml-version }} |
| 23 | + - name: Set up OCaml 4.14.x |
18 | 24 | uses: ocaml/setup-ocaml@v3 |
19 | 25 | 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 |
21 | 31 |
|
22 | 32 | - run: opam pin add goblint-cil.dev . --no-action |
23 | 33 | - run: opam depext goblint-cil --yes |
24 | 34 | - run: opam depext goblint-cil --yes --with-doc |
25 | 35 | - 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 |
27 | 38 | run: | |
28 | 39 | opam exec -- dune subst |
29 | 40 | opam exec -- dune build @heveadoc |
30 | 41 |
|
31 | | - - uses: actions/upload-artifact@v4 |
| 42 | + - name: Upload artifact |
| 43 | + uses: actions/upload-pages-artifact@v4 |
32 | 44 | with: |
33 | | - name: doc-html |
34 | | - path: _build/default/doc/html/cil |
| 45 | + path: _build/default/doc/html/cil/ |
35 | 46 |
|
36 | 47 | deploy: |
37 | | - if: github.ref == 'refs/heads/develop' |
| 48 | + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }} |
38 | 49 | 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 |
43 | 50 |
|
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 |
48 | 59 |
|
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