Move Haddock arguments earlier. #76
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
name: Build | |
concurrency: build | |
on: | |
push: | |
workflow_call: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.stack | |
key: stack-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('package.yaml', 'stack.yaml') }} | |
- name: Cache build artifacts | |
uses: actions/cache@v4 | |
with: | |
path: .stack-work | |
key: stack-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('app/**', 'bench/**', 'src/**', 'test/**') }} | |
- name: Setup | |
uses: haskell-actions/setup@v2 | |
with: | |
enable-stack: true | |
- name: Build | |
run: stack build --test --bench --haddock --haddock-arguments='--title="Ninety-Nine Haskell Problems" --use-contents=/ --use-index=/' --no-run-benchmarks --no-haddock-deps | |
- id: paths | |
name: Get path | |
if: ${{ github.ref_name == 'pages' }} | |
run: | | |
echo "docs=$(stack path --local-doc-root --no-haddock-deps)/ninetynine-$(stack query locals ninetynine version)" >> $GITHUB_OUTPUT | |
- name: Upload documentation | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docs | |
path: ${{ steps.paths.outputs.docs }} | |
deploy: | |
name: Deploy documentation | |
if: github.ref_name == 'pages' | |
needs: build | |
concurrency: deploy | |
runs-on: ubuntu-latest | |
# Permissions needed to deploy to GitHub Pages. | |
permissions: | |
pages: write | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: docs | |
path: _site | |
- id: customize | |
run: cp _site/Problems.html _site/index.html | |
- uses: actions/upload-pages-artifact@v3 | |
- uses: actions/deploy-pages@v4 |