1# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
2name: "Build documentation"
3
4permissions:
5 contents: read
6 pages: write
7 id-token: write
8
9on:
10 push:
11 branches:
12 - main
13 paths:
14 - "docs/**"
15
16jobs:
17 build:
18 runs-on: ubuntu-latest
19 steps:
20 - uses: actions/checkout@v4
21 - name: Install Nix
22 uses: DeterminateSystems/nix-installer-action@v10
23 with:
24 extra-conf: |
25 experimental-features = nix-command flakes
26
27 - name: Build site
28 run: "nix develop .#devShells.x86_64-linux.docs -c mdbook build docs"
29
30 - name: Upload built site as artifact
31 uses: actions/upload-pages-artifact@v3
32 with:
33 path: ./docs/dist
34
35 deploy:
36 environment:
37 name: github-pages
38 url: ${{ steps.deployment.outputs.page_url }}
39 runs-on: ubuntu-latest
40 needs: build
41 steps:
42 - name: Deploy to GitHub Pages
43 id: deployment
44 uses: actions/deploy-pages@v4