Skip to content

Commit 032578f

Browse files
committed
Publish haddocks on github-pages
1 parent 7f4fb90 commit 032578f

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

.github/workflows/github-page.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: "Haddock documentation"
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
haddocks:
10+
name: "Haddocks"
11+
12+
runs-on: ${{ matrix.os }}
13+
14+
defaults:
15+
run:
16+
shell: bash
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
ghc: ["9.10.1"]
22+
os: [ubuntu-latest]
23+
24+
permissions:
25+
pages: write
26+
id-token: write
27+
28+
environment:
29+
name: github-pages
30+
url: ${{ steps.deployment.outputs.page_url }}
31+
32+
steps:
33+
- name: Checkout ouroboros-network repository
34+
uses: actions/checkout@v3
35+
36+
# we need nix to later build the spec documents
37+
- name: Install Nix
38+
uses: cachix/install-nix-action@v20
39+
40+
- name: Install Haskell
41+
uses: haskell/actions/setup@v2
42+
id: setup-haskell
43+
with:
44+
ghc-version: ${{ matrix.ghc }}
45+
# we need unpublished `cabal` version to support sublibraries
46+
cabal-version: 'head'
47+
48+
- uses: actions/cache@v3
49+
name: Cache cabal store
50+
with:
51+
path: ${{ steps.setup-haskell.outputs.cabal-store }}
52+
key: cache-haddock-${{ runner.os }}-${{ matrix.ghc }}-v1-${{ hashFiles('cabal-cache.cabal') }}-${{ github.sha }}
53+
restore-keys: cache-haddock-${{ runner.os }}-${{ matrix.ghc }}-v1-${{ hashFiles('cabal-cache.cabal') }}-
54+
55+
- name: Update Hackage index
56+
run: cabal update
57+
58+
- name: Build plan
59+
run: cabal build --dry-run --enable-tests all
60+
61+
- name: Build Haddock documentation 🔧
62+
run: |
63+
cabal haddock-project --hackage all
64+
65+
- name: Upload artifacts
66+
uses: actions/upload-pages-artifact@v1
67+
with:
68+
path: ./haddocks
69+
70+
- name: Deploy 🚀
71+
id: deployment
72+
uses: actions/deploy-pages@v2
73+
74+

0 commit comments

Comments
 (0)