diff --git a/.github/workflows/haddock-site.yml b/.github/workflows/haddock-site.yml index 32dbb5981e0..98536a32631 100644 --- a/.github/workflows/haddock-site.yml +++ b/.github/workflows/haddock-site.yml @@ -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: @@ -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 @@ -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) diff --git a/scripts/combined-haddock.sh b/scripts/combined-haddock.sh index c7c3c4ee147..8f9e58fe651 100755 --- a/scripts/combined-haddock.sh +++ b/scripts/combined-haddock.sh @@ -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 \