@@ -0,0 +1,39 @@
1+{ stdenv, writeScript, coreutils, glibc, git, openssh, gnused, mkdocs }:
6+ repo = "git@github.com:input-output-hk/haskell.nix.git";
7+ sshKey = "/run/keys/buildkite-haskell-dot-nix-ssh-private";
9+ writeScript "update-docs.sh" ''
14+ export PATH="${makeBinPath [ coreutils glibc git openssh gnused mkdocs ]}"
22+ sed -i -e '/Build Date/d' site/index.html
23+ sed -i -e '/lastmod/d' site/sitemap.xml
24+ rm -f site/sitemap.xml.gz
25+ rev=$(git rev-parse --short HEAD)
27+ echo "Updating git index..."
28+ git checkout gh-pages
29+ GIT_WORK_TREE=$(pwd)/site git add -A
31+ echo "Committing changes..."
32+ git commit --no-gpg-sign --message "Update gh-pages for $rev"
34+ use_ssh_key ${sshKey}
36+ if [ "''${BUILDKITE_BRANCH:-}" = master ]; then
37+ git push ${repo} HEAD:gh-pages