chore: consolidate and compress TODODs #28
This file contains hidden or 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
| name: Deploy Haddock Documentation | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'libs/**' | |
| - 'cabal.project' | |
| - '.github/workflows/haddock.yml' | |
| workflow_dispatch: # Allow manual triggering | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Haskell | |
| uses: haskell-actions/setup@v2 | |
| with: | |
| ghc-version: '9.10.3' | |
| cabal-version: 'latest' | |
| - name: Update Cabal package index | |
| run: cabal update | |
| - name: Install dependencies | |
| run: cabal build all --only-dependencies | |
| - name: Build Haddock documentation | |
| run: | | |
| cabal haddock all --haddock-html --haddock-quickjump --haddock-hyperlink-source | |
| - name: Assemble Documentation | |
| id: haddock-dir | |
| run: | | |
| mkdir -p public | |
| # Find all generated documentation directories | |
| # Structure is .../doc/html/<package_name>/index.html | |
| find dist-newstyle -name "index.html" | grep "/doc/html/" | while read html_file; do | |
| doc_dir=$(dirname "$html_file") | |
| pkg_name=$(basename "$doc_dir") | |
| echo "Copying documentation for $pkg_name from $doc_dir" | |
| cp -R "$doc_dir" "public/$pkg_name" | |
| done | |
| echo "dir=public" >> $GITHUB_OUTPUT | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ${{ steps.haddock-dir.outputs.dir }} | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |