Skip to content

Commit 0256345

Browse files
authored
Move doc upload into its own GitHub workflow (#2371)
1 parent 326877b commit 0256345

File tree

2 files changed

+36
-10
lines changed

2 files changed

+36
-10
lines changed

.github/workflows/update-docs.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Updload Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
env:
9+
GH_TOKEN: ${{ github.token }}
10+
11+
jobs:
12+
wait-for-hydra:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Install Nix with good defaults
20+
uses: input-output-hk/install-nix-action@v20
21+
with:
22+
extra_nix_config: |
23+
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= loony-tools:pr9m4BkM/5/eSTZlkQyRt57Jz7OMBxNSUiMC4FkcNfk=
24+
substituters = https://cache.nixos.org/ https://cache.iog.io/ https://cache.zw3rk.com
25+
nix_path: nixpkgs=channel:nixos-unstable
26+
27+
- name: Update docs
28+
run: |
29+
nix-build build.nix -A maintainer-scripts.update-docs -o update-docs.sh
30+
./update-docs.sh
31+
32+
- name: Upload docs
33+
run: |
34+
git config --global user.name 'Auto Update Bot'
35+
git config --global user.email '[email protected]'
36+
git push origin gh-pages

scripts/update-docs.nix

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33

44
with lib;
55

6-
let
7-
repo = "[email protected]:input-output-hk/haskell.nix.git";
8-
sshKey = "/run/keys/buildkite-haskell-dot-nix-ssh-private";
9-
in
106
# update-docs depends on glibc which doesn't build on darwin
117
meta.addMetaAttrs { platforms = platforms.linux; } (writeScript "update-docs.sh" ''
128
#!${stdenv.shell}
@@ -37,10 +33,4 @@ in
3733
check_staged
3834
echo "Committing changes..."
3935
git commit --no-gpg-sign --message "Update gh-pages for $rev"
40-
41-
use_ssh_key ${sshKey}
42-
43-
if [ "''${GITHUB_REF:-}" = refs/heads/master ]; then
44-
git push ${repo} HEAD:gh-pages
45-
fi
4636
'')

0 commit comments

Comments
 (0)