Skip to content

Merge pull request #120 from matthew-healy/matthew-healy/dont-defer-t… #3

Merge pull request #120 from matthew-healy/matthew-healy/dont-defer-t…

Merge pull request #120 from matthew-healy/matthew-healy/dont-defer-t… #3

Workflow file for this run

# Build the docs on every commit
# Also deploy when pushed to 'develop' (if they built OK)
name: Documentation CI/CD
on: [push, pull_request]
jobs:
build-docs-job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: build website contents
run: |
cp package.yaml.pandoc package.yaml
mkdir -p _site dist
nix-shell --pure --run hpack
nix-shell --pure --run "runghc ./Setup.hs configure --prefix=$PWD/out"
nix-shell --pure --run "runghc ./Setup.hs build && runghc ./Setup.hs install"
nix-shell --pure --run "make NO_STACK=y html"
nix-shell --pure --run "make NO_STACK=y pdf"
cp dist/pbook.pdf _site/book.pdf
- uses: actions/upload-artifact@v3
with:
name: generated-site
path: _site
deploy-docs-job:
runs-on: ubuntu-latest
needs: build-docs-job
permissions:
contents: write
# Only deploy docs from 'main' branch (and if they built OK).
if: success() && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: generated-site
path: _site
- name: deploy website contents
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: _site
target-folder: docs