Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to haddock-site.yml (support auto-publish on push to master) #6276

Merged
merged 3 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading