@@ -0,0 +1,52 @@
1+SERVANT_DIR=/tmp/servant-gh-pages
2+
3+# Make a temporary clone
4+
5+rm -rf $SERVANT_DIR
6+
7+git clone . $SERVANT_DIR
8+
9+cd $SERVANT_DIR
10+
11+# Make sure to pull the latest
12+
13+git remote add haskell-servant git@github.com:haskell-servant/servant.git
14+
15+git fetch haskell-servant
16+
17+git reset --hard haskell-servant/gh-pages
18+
19+# Clear everything away
20+
21+git rm -rf $SERVANT_DIR/*
22+
23+# Switch back and build the haddocks
24+
25+cd -
26+
27+cabal configure --builddir=$SERVANT_DIR
28+
29+cabal haddock --hoogle --hyperlink-source --html-location='https://hackage.haskell.org/package/$pkg-$version/docs' --builddir=$SERVANT_DIR
30+
31+commit_hash=$(git rev-parse HEAD)
32+
33+# Move the HTML docs to the root
34+
35+cd $SERVANT_DIR
36+
37+rm *
38+rm -rf build
39+mv doc/html/servant/* .
40+rm -r doc/
41+
42+# Add everything
43+
44+git add .
45+
46+git commit -m "Built from $commit_hash"
47+
48+# Push to update the pages
49+
50+git push haskell-servant HEAD:gh-pages
51+
52+rm -rf $SERVANT_DIR