Skip to content

Commit 143c228

Browse files
committed
Publish haddocks on gh-pages
1 parent a8af24c commit 143c228

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

.github/workflows/github-page.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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.4.4"]
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+
cabal-version: '3.10.1.0'
46+
47+
- uses: actions/cache@v3
48+
name: Cache cabal store
49+
with:
50+
path: ${{ steps.setup-haskell.outputs.cabal-store }}
51+
key: cache-haddock-${{ runner.os }}-${{ matrix.ghc }}-v1-${{ hashFiles('cabal-cache.cabal') }}-${{ github.sha }}
52+
restore-keys: cache-haddock-${{ runner.os }}-${{ matrix.ghc }}-v1-${{ hashFiles('cabal-cache.cabal') }}-
53+
54+
- name: Update Hackage index
55+
run: cabal update
56+
57+
- name: Build plan
58+
run: cabal build --dry-run --enable-tests all
59+
60+
- name: Build Haddock documentation 🔧
61+
run: |
62+
cabal haddock-package --hackage all
63+
64+
- name: Upload artifacts
65+
uses: actions/upload-pages-artifact@v1
66+
with:
67+
path: ./haddocks
68+
69+
- name: Deploy 🚀
70+
id: deployment
71+
uses: actions/deploy-pages@v2
72+

0 commit comments

Comments
 (0)