Build and push website #746
This file contains hidden or 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 and push website | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 3 * * *' | |
concurrency: | |
# Cancels jobs running if new commits are pushed | |
group: > | |
${{ github.workflow }}- | |
${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build_website: | |
name: Run doc build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: firedrake-repo | |
repository: firedrakeproject/firedrake | |
ref: release | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install python3 | |
sudo apt-get -y install \ | |
$(python3 ./firedrake-repo/scripts/firedrake-configure \ | |
--arch default --show-system-packages) \ | |
inkscape texlive-full python3-venv | |
- name: Install PETSc | |
run: | | |
git clone --depth 1 \ | |
--branch $(python3 ./firedrake-repo/scripts/firedrake-configure --show-petsc-version) \ | |
https://gitlab.com/petsc/petsc.git | |
cd petsc | |
python3 ../firedrake-repo/scripts/firedrake-configure \ | |
--arch default --show-petsc-configure-options | \ | |
xargs -L1 ./configure --download-slepc | |
make PETSC_DIR=/home/runner/work/firedrakeproject.github.io/firedrakeproject.github.io/petsc PETSC_ARCH=arch-firedrake-default | |
make check | |
{ | |
echo "PETSC_DIR=/home/runner/work/firedrakeproject.github.io/firedrakeproject.github.io/petsc" | |
echo "PETSC_ARCH=arch-firedrake-default" | |
echo "SLEPC_DIR=/home/runner/work/firedrakeproject.github.io/firedrakeproject.github.io/petsc/arch-firedrake-default" | |
} >> "$GITHUB_ENV" | |
- name: Install Firedrake | |
run: | | |
export $(python3 ./firedrake-repo/scripts/firedrake-configure --arch default --show-env) | |
python3 -m venv venv | |
. venv/bin/activate | |
pip install --verbose \ | |
--no-binary h5py \ | |
--extra-index-url https://download.pytorch.org/whl/cpu \ | |
'./firedrake-repo[docs]' | |
pip list | |
- name: Check bibtex | |
run: | | |
. venv/bin/activate | |
make -C firedrake-repo/docs validate-bibtex | |
- name: Build docs | |
run: | | |
. venv/bin/activate | |
cd firedrake-repo/docs | |
make SPHINXOPTS="-t release" html | |
make latex | |
make latexpdf | |
- name: Copy manual to HTML tree | |
id: copy | |
run: | | |
cd firedrake-repo/docs | |
cp build/latex/Firedrake.pdf build/html/_static/manual.pdf | |
- name: Upload artifact | |
id: upload | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
name: github-pages | |
path: ./firedrake-repo/docs/build/html | |
retention-days: 1 | |
deploy: | |
name: Deploy Github pages | |
needs: build_website | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: https://firedrakeproject.github.io | |
steps: | |
- name: Deploy to GitHub Pages | |
uses: actions/deploy-pages@v4 |