Skip to content

Commit 751279e

Browse files
committed
ci: push haddocks to GH pages in ci.
1 parent 8caa977 commit 751279e

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,30 @@ jobs:
3838
- name: Build and run tests (macOS, x86_64 via Rosetta)
3939
if: runner.os == 'macOS'
4040
run: nix build -L .#packages.x86_64-darwin.default
41+
42+
docs:
43+
runs-on: ubuntu-latest
44+
needs: build
45+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
46+
permissions:
47+
contents: write
48+
steps:
49+
- uses: actions/checkout@v4
50+
51+
- uses: cachix/install-nix-action@v31
52+
with:
53+
nix_path: nixpkgs=channel:nixpkgs-unstable
54+
55+
- name: Build (produces Haddock docs via cabal)
56+
run: nix build -L
57+
58+
- name: Collect Haddock output
59+
run: |
60+
html=$(find -L result/share/doc -type d -name html | head -1)
61+
echo "HADDOCK_DIR=$html" >> "$GITHUB_ENV"
62+
63+
- name: Deploy to GitHub Pages
64+
uses: peaceiris/actions-gh-pages@v4
65+
with:
66+
github_token: ${{ secrets.GITHUB_TOKEN }}
67+
publish_dir: ${{ env.HADDOCK_DIR }}

0 commit comments

Comments
 (0)