Add a GitHub workflow to publish Haddock #3
Workflow file for this run
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
concurrency: | |
cancel-in-progress: false | |
group: pages | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- uses: cachix/install-nix-action@v23 | |
with: | |
extra_nix_config: | | |
extra-trusted-public-keys = cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g= | |
extra-substituters = https://cache.garnix.io | |
- uses: lriesebos/nix-develop-command@v1 | |
with: | |
command: | | |
mkdir _site | |
cabal haddock \ | |
--haddock-html \ | |
--haddock-quickjump \ | |
--haddock-option='--use-index=../doc-index.html' \ | |
--haddock-option='--use-contents=../index.html' \ | |
--haddock-option='--base-url=..' \ | |
all | |
cp -r dist-newstyle/build/*/*/*/doc/html/*/ _site/ | |
## TODO: Remove need to enumerate all packages | |
haddock -o _site --quickjump --gen-index --gen-contents \ | |
--read-interface=concat-classes,docs/concat-classes/concat-classes.haddock \ | |
--read-interface=concat-examples,docs/concat-examples/concat-examples.haddock \ | |
--read-interface=concat-graphics,docs/concat-graphics/concat-graphics.haddock \ | |
--read-interface=concat-hardware,docs/concat-hardware/concat-hardware.haddock \ | |
--read-interface=concat-inline,docs/concat-inline/concat-inline.haddock \ | |
--read-interface=concat-known,docs/concat-known/concat-known.haddock \ | |
--read-interface=concat-plugin,docs/concat-plugin/concat-plugin.haddock \ | |
--read-interface=concat-satisfy,docs/concat-satisfy/concat-satisfy.haddock | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
deploy: | |
environment: | |
name: github-pages | |
url: "$" | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- id: deployment | |
name: Deploy to GitHub Pages | |
uses: actions/deploy-pages@v2 | |
name: Deploy generated docs to Pages | |
'on': | |
push: | |
branches: | |
- add-haddock | |
workflow_dispatch: | |
permissions: | |
contents: read | |
id-token: write | |
pages: write |