-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (52 loc) · 1.88 KB
/
documentation.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Documentation
on:
push:
branches: [master]
jobs:
build-and-deploy:
if: contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install cabal/ghc
uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: '9.6.3'
cabal-version: '3.10.2.0'
- name: Set PATH for cabal-installed executables
run: |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
- name: Set Cabal options
# Overwriting prevent cabal from raising an error when installing
# an executable that is already present (because of caching)
# Some of these options are superfluous for this workflow,
# but I'm keeping them in sync with ci.yml so that caching is
# shared
run: |
cabal update
cabal user-config update -f -a "overwrite-policy: always"
cabal user-config update -f -a "install-method: copy"
cabal user-config update -f -a "split-sections: True"
cabal user-config update -f -a "executable-stripping: True"
- name: Cache cabal work
uses: actions/cache@v3
with:
path: |
dist-newstyle
${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ runner.os }}-${{ hashFiles('cabal.*') }}-cabal-install
# We are building twice such that we can see build errors. If successful,
# the second build should be fast
- name: Build documentation
run: |
cabal haddock javelin -j --disable-optimization
htmlloc=$(cabal haddock javelin -j --disable-optimization | tail -n 1)
mkdir docs
cp -r $htmlloc docs
- name: Deploy
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: docs/javelin
clean: true