-
Notifications
You must be signed in to change notification settings - Fork 270
69 lines (59 loc) · 1.76 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
name: Haddocks
defaults:
run:
working-directory: unison
shell: bash
on:
push:
branches:
- trunk
jobs:
build:
name: Haddocks
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
path: unison
- name: restore stack caches
uses: unisonweb/actions/stack/cache/restore@main
with:
cache-prefix: haddocks
stack-yaml-dir: unison
- name: install stack
uses: unisonweb/actions/stack/install@main
with:
stack-version: 2.15.5
- name: build with haddocks
working-directory: unison
run: stack build --fast --haddock
- name: save stack caches
uses: unisonweb/actions/stack/cache/save@main
with:
cache-prefix: haddocks
stack-yaml-dir: unison
# Haddocks
- name: Checkout haddocks branch
uses: actions/checkout@v4
with:
ref: haddocks
path: haddocks
# Needed for `git commit` below
- name: set git user info
working-directory: unison
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
- name: Copy haddocks
working-directory: unison
run: |
docs_root="$(stack path --local-doc-root)"
# Erase any stale files
cd "$GITHUB_WORKSPACE"/haddocks
rm -rf ./*
git checkout --orphan fresh-haddocks-branch
cp -r "${docs_root}"/* "$GITHUB_WORKSPACE"/haddocks
git add .
git commit -m "Regenerated haddocks based on ${GITHUB_SHA}"
# Push the branch with only a single commit over the remote
git push --force origin fresh-haddocks-branch:haddocks