Skip to content

Build Gusto Documentation website #250

Build Gusto Documentation website

Build Gusto Documentation website #250

Workflow file for this run

name: Build Gusto Documentation website
on:
push:
branches:
- main
workflow_dispatch:
schedule:
- cron: '0 3 * * *'
jobs:
build_website:
name: Run doc build
runs-on: ubuntu-latest
container:
image: firedrakeproject/firedrake-vanilla-default:latest
env:
# Since we are running as root we need to set PYTHONPATH to be able to find the installed
# packages
PYTHONPATH: /home/firedrake/firedrake:/home/firedrake/.local/lib/python3.12/site-packages
steps:
- uses: actions/checkout@v4
with:
repository: firedrakeproject/gusto
path: gusto-repo
- name: Install Gusto
run: |
: # Pass '--system-site-packages' so already installed packages can be found
python3 -m venv --system-site-packages venv-gusto
. venv-gusto/bin/activate
pip install ./gusto-repo[docs]
- name: Check documentation links
if: ${{ github.ref == 'refs/heads/main' }}
run: |
. venv-gusto/bin/activate
cd gusto-repo/docs
make linkcheck
- name: Build docs
run: |
. venv-gusto/bin/activate
cd gusto-repo/docs
make html
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
name: github-pages
path: /__w/gusto-docs/gusto-docs/gusto-repo/docs/build/html
retention-days: 1
- name: Fix repo permissions
run: |
git config --global --add safe.directory /__w/gusto-docs/gusto-docs
keepalive-job:
name: Keepalive Workflow
if: ${{ always() }}
needs: build_website
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- uses: actions/checkout@v4
- uses: gautamkrishnar/keepalive-workflow@v2
with:
use_api: false
deploy:
name: Deploy Github pages
needs: build_website
if: ${{ github.ref == 'refs/heads/main' }}
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: https://firedrakeproject.github.io/gusto/docs
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4