Skip to content

Commit

Permalink
wip: docs update GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
johnalotoski committed Nov 23, 2023
1 parent 8fafbe1 commit 77cc3a0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,25 @@ jobs:
nix-build -A maintainer-scripts.update-docs -o update-docs.sh
./update-docs.sh
update-docs-test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Nix
uses: cachix/install-nix-action@v20
with:
extra_nix_config: |
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
substituters = https://cache.iog.io https://cache.nixos.org/
- name: Run nix-build
run: |
nix-build -A maintainer-scripts.update-docs -o update-docs.sh
./update-docs.sh
check-stylish-haskell:
name: Check Stylish Haskell
runs-on: ubuntu-latest
Expand Down
15 changes: 10 additions & 5 deletions scripts/update-docs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ in
#!${stdenv.shell}
set -euo pipefail
set -x
export PATH="${makeBinPath [ coreutils glibc git openssh gnused mkdocs pandocOrgMdFilter pandoc ]}"
source ${./git.env}
rev=$(git rev-parse --short HEAD)
BRANCH=$(git rev-parse --abbrev-ref HEAD)
REV=$(git rev-parse --short HEAD)
cd $(git rev-parse --show-toplevel)
echo "Preprocessing..."
Expand All @@ -45,9 +47,12 @@ in
GIT_WORK_TREE=$(pwd)/site git add -A
check_staged
echo "Committing changes..."
git commit --no-gpg-sign --message "Update gh-pages for $rev"
git commit --no-gpg-sign --message "Update gh-pages for $REV"
# if [ "''${BUILDKITE_BRANCH:-}" = master ]; then
# git push ${repo} HEAD:gh-pages
# fi
git diff HEAD~..HEAD
if [ "$BRANCH" = master ]; then
echo "Would push"
# git push ${repo} HEAD:gh-pages
fi
'')

0 comments on commit 77cc3a0

Please sign in to comment.