π Haddock Site #387
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow builds and deploys the Haddock site. | |
# | |
# When this workflow is triggered manually via workflow dispatch, it builds and then | |
# publishes the site according to the 'ref' input: | |
# https://plutus.cardano.intersectmbo.org/haddock/$ref | |
# And optionally (if the 'latest' flag is set) to: | |
# https://plutus.cardano.intersectmbo.org/haddock/latest | |
# | |
# This workflow also builds and publishes the site on push to master to: | |
# https://plutus.cardano.intersectmbo.org/haddock/master | |
# | |
# This workflow does not trigger on each pull request because it takes about 1h to run. | |
# However it will build (but not deploy) the site on pull requests to the release/* branches. | |
name: "π Haddock Site" | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- 'release/*' | |
workflow_dispatch: | |
inputs: | |
ref: | |
description: | | |
The ref to build off of, e.g. "1.29.0.0", "master", or any other valid git ref. | |
When making a release, this is usually the version tag, e.g. "1.29.0.0", and will be | |
equal to the $destination input below. When back-porting this could be a commit sha instead. | |
required: true | |
type: string | |
destination: | |
description: | | |
The destination folder, e.g. when "1.29.0.0" the haddock site will be deployed to: | |
https://plutus.cardano.intersectmbo.org/haddock/1.29.0.0 | |
required: true | |
type: string | |
latest: | |
description: | | |
If true, then the haddock site will also be deployed to: | |
https://plutus.cardano.intersectmbo.org/haddock/latest. | |
You want to check this when you are making a release. | |
You want to uncheck this when you are deploying old versions or back-porting. | |
type: boolean | |
required: true | |
default: true | |
script_ref: | |
description: | | |
What branch to fetch the combined-haddock.sh script from. | |
Leave this to 'master' unless you are testing a new version of the script. | |
type: string | |
required: true | |
default: 'master' | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: [self-hosted, plutus-ci] | |
permissions: | |
contents: write | |
environment: | |
name: github-pages | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
with: | |
ref: ${{ inputs.ref || github.ref_name }} | |
- name: Checkout Haddock Script | |
run: | | |
git fetch origin ${{ inputs.script_ref || github.ref_name }} | |
git checkout origin/${{ inputs.script_ref || github.ref_name }} ./scripts/combined-haddock.sh | |
- name: Build Site | |
run: | | |
nix develop --no-warn-dirty --accept-flake-config --command ./scripts/combined-haddock.sh _haddock all | |
- name: Deploy Site | |
uses: JamesIves/[email protected] | |
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
with: | |
folder: _haddock | |
target-folder: haddock/${{ inputs.destination || github.ref_name }} | |
single-commit: true | |
- name: Deploy Site (latest) | |
if: ${{ inputs.latest == true }} | |
uses: JamesIves/[email protected] | |
with: | |
folder: _haddock | |
target-folder: haddock/latest | |
single-commit: true |