Skip to content

Commit

Permalink
Test documentation website build in CI, remove redundant steps from CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisdral committed Aug 11, 2023
1 parent 74bffb1 commit 6c0fdf8
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 26 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,32 +211,6 @@ jobs:
path: haddocks.tgz
retention-days: 1

# NB: build the haddocks at the end to avoid unecessary recompilations.
# We build the haddocks only for one GHC version.
- name: Build Haddock documentation
if: |
github.event_name == 'push'
&& github.ref == 'refs/heads/main'
&& matrix.os=='ubuntu-latest'
&& matrix.ghc=='8.10.7'
run: |
cabal build --dry-run --enable-tests all
./scripts/docs/haddocks.sh
tar vzcf haddocks.tgz ./docs/website/static/haddocks
- name: Upload haddocks as an artifact
if: |
github.event_name == 'push'
&& github.ref == 'refs/heads/main'
&& matrix.os=='ubuntu-latest'
&& matrix.ghc=='8.10.7'
uses: actions/upload-artifact@v3
with:
name: haddocks
path: haddocks.tgz
retention-days: 1


deploy-documentation:
name: Deploy documentation to GitHub Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Documentation

# Limit concurrent runs of this workflow within a single PR
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

on:
pull_request:

jobs:
# https://docusaurus.io/docs/deployment#triggering-deployment-with-github-actions
#
# We test the website build on pull requests, without building any static
# assets (pdfs, haddocks), and without deploying the website to github-pages.
# The build should still succeed regardless, and serves as a check before we
# deploy the documentation website on the default branch.
test-deploy-documentation:
name: Test documentation deployment
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docs/website
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
cache-dependency-path: './docs/website/yarn.lock'

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Test build website
run: yarn build

0 comments on commit 6c0fdf8

Please sign in to comment.