Skip to content

Improve haddock docs #220

Improve haddock docs

Improve haddock docs #220

Workflow file for this run

name: Generate and deploy documentation
on:
push:
branches: [ master ]
jobs:
GenDoc:
name: Generate documentation
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: haskell/actions/setup@v1
with:
ghc-version: '9.2.1'
- name: Generate documentation
run: |
cabal haddock \
--haddock-html \
--haddock-option "--odir=doc" \
--haddock-option "--title=blarney" \
--haddock-option "--source-module=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/tree/$GITHUB_SHA/%{FILE}" \
--haddock-option "--source-entity=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/tree/$GITHUB_SHA/%{FILE}#L%{LINE}" \
- name: Upload documentation artifact
uses: actions/upload-artifact@v2
with:
name: doc
path: doc
PublishDoc:
name: Publish documentation
needs: GenDoc
runs-on: ubuntu-latest
steps:
- name: Download documentation artifact
uses: actions/download-artifact@v2
with:
name: doc
- name: Deploy documentation
run: |
git init
git checkout --orphan haddock
git remote add origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git config user.name the-blarney-fairy
git config user.email the-blarney-fairy@users.noreply.github.com
git add --all
git commit -m "deploy documentation for $GITHUB_SHA"
git push origin -f haddock