Preparation for 1.9.0 release #306
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: GH-Pages | |
on: | |
push: | |
branches: [master] | |
paths-ignore: | |
- '.github/workflows/ci.yml' | |
jobs: | |
build-docs-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install cabal/ghc | |
uses: haskell/actions/setup@v1 | |
id: setup-haskell | |
with: | |
ghc-version: '9.2.4' | |
cabal-version: '3.10.1.0' | |
- name: Set PATH for cabal-installed executables | |
run: | | |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH | |
- name: Set Cabal options | |
# Overwriting prevent cabal from raising an error when installing | |
# an executable that is already present (because of caching) | |
# Some of these options are superfluous for this workflow, | |
# but I'm keeping them in sync with ci.yml so that caching is | |
# shared | |
run: | | |
cabal update | |
cabal user-config update -f -a "overwrite-policy: always" | |
cabal user-config update -f -a "install-method: copy" | |
cabal user-config update -f -a "split-sections: True" | |
cabal user-config update -f -a "executable-stripping: True" | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' | |
- name: Cache cabal work | |
uses: actions/cache@v2 | |
with: | |
path: | | |
dist-newstyle | |
${{ steps.setup-haskell.outputs.cabal-store }} | |
key: ${{ runner.os }}-${{ hashFiles('cabal.project.freeze') }}-cabal-install-v2 | |
- uses: actions/cache@v3 | |
name: Cache Python build artifacts | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-${{ hashFiles('.github/workflows/gh_pages_requirements.txt') }} | |
- name: Install pandoc-plot and other dependencies | |
run: | | |
cabal install pandoc-cli | |
cabal install exe:pandoc-plot | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r .github/workflows/gh_pages_requirements.txt | |
- name: Build documentation | |
run: source tools/mkmanual.sh | |
- name: Build website | |
run: | | |
cd docs | |
pandoc-plot clean index.md | |
VERSION=$(pandoc-plot --version) | |
mkdir build | |
pandoc --standalone \ | |
--css=theme.css \ | |
--filter pandoc-plot \ | |
--metadata title="pandoc-plot $VERSION" \ | |
-i index.md \ | |
-o build/index.html | |
mv -v MANUAL.html theme.css plots build | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
branch: gh-pages | |
folder: docs/build | |
clean: true |