diff --git a/.github/workflows/update-docs.yml b/.github/workflows/update-docs.yml new file mode 100644 index 000000000..c3a7cc52f --- /dev/null +++ b/.github/workflows/update-docs.yml @@ -0,0 +1,36 @@ +name: Updload Docs + +on: + push: + branches: + - master + +env: + GH_TOKEN: ${{ github.token }} + +jobs: + wait-for-hydra: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Nix with good defaults + uses: input-output-hk/install-nix-action@v20 + with: + extra_nix_config: | + 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= + substituters = https://cache.nixos.org/ https://cache.iog.io/ https://cache.zw3rk.com + nix_path: nixpkgs=channel:nixos-unstable + + - name: Update docs + run: | + nix-build build.nix -A maintainer-scripts.update-docs -o update-docs.sh + ./update-docs.sh + + - name: Upload docs + run: | + git config --global user.name 'Auto Update Bot' + git config --global user.email 'no-reply@iohk.io' + git push origin gh-pages diff --git a/scripts/update-docs.nix b/scripts/update-docs.nix index 133171582..273006fcd 100644 --- a/scripts/update-docs.nix +++ b/scripts/update-docs.nix @@ -3,10 +3,6 @@ with lib; -let - repo = "git@github.com:input-output-hk/haskell.nix.git"; - sshKey = "/run/keys/buildkite-haskell-dot-nix-ssh-private"; -in # update-docs depends on glibc which doesn't build on darwin meta.addMetaAttrs { platforms = platforms.linux; } (writeScript "update-docs.sh" '' #!${stdenv.shell} @@ -37,10 +33,4 @@ in check_staged echo "Committing changes..." git commit --no-gpg-sign --message "Update gh-pages for $rev" - - use_ssh_key ${sshKey} - - if [ "''${GITHUB_REF:-}" = refs/heads/master ]; then - git push ${repo} HEAD:gh-pages - fi '')