-
Notifications
You must be signed in to change notification settings - Fork 157
83 lines (68 loc) · 2.22 KB
/
gh-pages.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
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
name: Haddocks to GitHub Pages
on:
push:
branches: [ "master" ]
workflow_dispatch:
jobs:
gh-pages:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Install Haskell
uses: input-output-hk/setup-haskell@v1
id: setup-haskell
with:
ghc-version: "9.2.8"
cabal-version: latest
- name: Install system dependencies
uses: input-output-hk/actions/base@latest
with:
use-sodium-vrf: false # default is true
- name: Configure to use libsodium
run: |
cat >> cabal.project <<EOF
package cardano-crypto-praos
flags: -external-libsodium-vrf
EOF
- name: Cabal update
run: cabal update
- name: Build haddocks
run: scripts/haddocks.sh haddocks all
- name: Add files
run: |
git config --local user.name ${{ github.actor }}
git config --local user.email "${{ github.actor }}@users.noreply.github.com"
# Start a new version of the gh-pages branch
git for-each-ref refs/heads/gh-pages --format='%(refname:short)' |
while read -r REFNAME; do
git branch -D "$REFNAME"
done
git checkout -b gh-pages
git rm -rfq .
git commit -qm "Remove all existing files"
echo "cardano-ledger.cardano.intersectmbo.org" >CNAME
touch .nojekyll
git add CNAME .nojekyll
git commit -qm "Add CNAME and .nojekyll"
# Preserve benchmark results, if any
git ls-remote origin --heads gh-pages |
while read -r _SHA REFNAME; do
git fetch origin "$REFNAME"
if git diff --name-only FETCH_HEAD -- dev | grep -q .; then
git checkout FETCH_HEAD dev
git commit -qC "$(git log -1 --format=%H FETCH_HEAD dev)"
fi
done
# Add Haddocks
git add -A --force ./haddocks
git mv ./haddocks/* .
git commit -qm "Updated from ${GITHUB_SHA} via ${GITHUB_EVENT_NAME}"
- name: Push to gh-pages
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
force: true
directory: .