-
Notifications
You must be signed in to change notification settings - Fork 11
51 lines (47 loc) · 1.52 KB
/
documentation.yml
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
name: Generate and deploy documentation
on:
push:
branches: [ master ]
jobs:
GenDoc:
name: Generate documentation
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: haskell/actions/setup@v1
with:
ghc-version: '9.2.1'
- name: Generate documentation
run: |
cabal install --lib async
haddock --source-module=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/tree/$GITHUB_SHA/%{FILE} \
--source-entity=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/tree/$GITHUB_SHA/%{FILE}#L%{LINE} \
--title=blarney \
--optghc=-XNoImplicitPrelude \
--html \
--odir doc \
$(find Haskell/ -name "*.hs" | grep -v BlarneyPlugins)
- name: Upload documentation artifact
uses: actions/upload-artifact@v2
with:
name: doc
path: doc
PublishDoc:
name: Publish documentation
needs: GenDoc
runs-on: ubuntu-latest
steps:
- name: Download documentation artifact
uses: actions/download-artifact@v2
with:
name: doc
- name: Deploy documentation
run: |
git init
git checkout --orphan haddock
git remote add origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git config user.name the-blarney-fairy
git config user.email the-blarney-fairy@users.noreply.github.com
git add --all
git commit -m "deploy documentation for $GITHUB_SHA"
git push origin -f haddock