Skip to content

Commit 2a33662

Browse files
authored
Merge pull request #40 from input-output-hk/coot/gh-pages
Publish haddocks on gh-pages
2 parents 071fed3 + d69c3ee commit 2a33662

File tree

2 files changed

+74
-2
lines changed

2 files changed

+74
-2
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+

.github/workflows/haskell.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
cabal --version
8282
echo "cabal-store=$(dirname $(cabal --help | tail -1 | tr -d ' '))\\store" >> $GITHUB_OUTPUT
8383
84-
- uses: actions/checkout@v2
84+
- uses: actions/checkout@v3
8585

8686
- name: "Configure cabal.project.local"
8787
run: |
@@ -140,7 +140,7 @@ jobs:
140140
sudo apt-get -y install fd-find
141141
142142
- name: "Setup Haskell"
143-
uses: haskell/actions/setup@v1
143+
uses: haskell/actions/setup@v2
144144
id: setup-haskell
145145
with:
146146
ghc-version: 9.2.5

0 commit comments

Comments
 (0)