Build and push website #910
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 | |
container: | |
image: firedrakeproject/firedrake-vanilla-default:dev-release | |
steps: | |
- name: Install documentation dependencies | |
run: | | |
python3 -m pip install --no-build-isolation '/opt/firedrake[docs]' | |
- name: Install system dependencies | |
run: | | |
apt-get update | |
apt-get -y install inkscape texlive-full | |
- name: Build documentation | |
working-directory: /opt/firedrake/docs | |
run: | | |
make SPHINXOPTS="-t release" html | |
make latex | |
make latexpdf | |
- name: Copy manual to HTML tree | |
working-directory: /opt/firedrake/docs | |
run: | | |
cp build/latex/Firedrake.pdf build/html/_static/manual.pdf | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
name: github-pages | |
path: /opt/firedrake/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 |