Skip to content

Commit

Permalink
Improvements to haddock-site.yml (support auto-publish on push to mas…
Browse files Browse the repository at this point in the history
…ter) (#6276)
  • Loading branch information
zeme-wana authored and effectfully committed Aug 6, 2024
1 parent 7fca453 commit f50c9ec
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/haddock-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
# https://intersectmbo.github.io/plutus/haddock/$version
# And optionally to:
# https://intersectmbo.github.io/plutus/haddock/latest
# On push to master, this workflows publishes to:
# https://intersectmbo.github.io/plutus/haddock/master

name: "📜 Haddock Site"

on:
push:
branches:
- master
workflow_dispatch:
inputs:
ref:
Expand Down Expand Up @@ -44,8 +49,13 @@ jobs:
- name: Checkout
uses: actions/checkout@main
with:
ref: ${{ inputs.ref }}
ref: ${{ inputs.ref || github.ref_name }}

- name: Checkout Haddock Script
run: |
git fetch origin master
git checkout origin/master ./scripts/combined-haddock.sh
- name: Build Site
run: |
nix develop --no-warn-dirty --accept-flake-config --command ./scripts/combined-haddock.sh _haddock all
Expand All @@ -54,7 +64,7 @@ jobs:
uses: JamesIves/github-pages-deploy-action@v4.6.1
with:
folder: _haddock
target-folder: haddock/${{ inputs.destination }}
target-folder: haddock/${{ inputs.destination || github.ref_name }}
single-commit: true

- name: Deploy Site (latest)
Expand Down
7 changes: 7 additions & 0 deletions scripts/combined-haddock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,13 @@ for failure in "${BROKEN_LINKS[@]}"; do
done


echo "Looking for linkchecker"
if ! command -v linkchecker &> /dev/null; then
echo "linkchecker not found"
exit 0
done


echo "Running linkchecker"
time linkchecker "${OUTPUT_DIR}/index.html" \
--check-extern \
Expand Down

0 comments on commit f50c9ec

Please sign in to comment.