-
Notifications
You must be signed in to change notification settings - Fork 273
94 lines (83 loc) · 3.41 KB
/
haddocks.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Haddocks
defaults:
run:
working-directory: unison
shell: bash
on:
push:
branches:
- trunk
# TODO: remove
- cp/firebase-haddocks
jobs:
build:
name: Haddocks
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
path: unison
# The number towards the beginning of the cache keys allow you to manually avoid using a previous cache.
# GitHub will automatically delete caches that haven't been accessed in 7 days, but there is no way to
# purge one manually.
# Cache ~/.stack, keyed by the contents of 'stack.yaml'.
- uses: actions/cache@v2
name: cache ~/.stack
with:
path: ~/.stack
# Main cache key: commit hash. This should always result in a cache miss...
# So when loading a cache we'll always fall back to the restore-keys,
# which should load the most recent cache via a prefix search on the most
# recent branch cache.
# Then it will save a new cache at this commit sha, which should be used by
# the next build on this branch.
key: stack-0-haddocks-${{github.sha}}
# Fall-back to the most recent haddocks build, or to a standard Linux build failing that.
restore-keys: |
stack-0-haddocks
stack-0-Linux
# Cache each local package's ~/.stack-work for fast incremental builds in CI.
- uses: actions/cache@v2
name: cache .stack-work
with:
path: |
**/.stack-work
# Main cache key: commit hash. This should always result in a cache miss...
# So when loading a cache we'll always fall back to the restore-keys,
# which should load the most recent cache via a prefix search on the most
# recent branch cache.
# Then it will save a new cache at this commit sha, which should be used by
# the next build on this branch.
key: stack-work-2-haddocks-${{github.sha}}
# Fall-back to the most recent haddocks build, or to a standard Linux build failing that.
restore-keys: |
stack-work-2_Linux-haddocks
stack-work-2_Linux
- name: install stack (Linux)
working-directory: ${{ github.workspace }}
run: |
mkdir stack && cd stack
curl -L https://github.com/commercialhaskell/stack/releases/download/v2.9.1/stack-2.9.1-linux-x86_64.tar.gz | tar -xz
echo "$PWD/stack-"* >> $GITHUB_PATH
# One of the transcripts fails if the user's git name hasn't been set.
- name: set git user info
working-directory: unison
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
- name: build with haddocks
working-directory: unison
run: stack --no-terminal build --fast --haddock
- name: Copy haddocks to firebase site
working-directory: 'unison'
run: |
docs_root="$(stack path --local-doc-root)"
# Erase any stale files
rm -rf ./haddocks/public
cp -r "${docs_root}" ./haddocks/public
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_UNISON_DOCS }}'
channelId: live
projectId: unison-docs
entryPoint: '${{ github.workspace }}/haddocks'