Skip to content

Workflow file for this run

name: 'Doc build (HTML & PDF)'
on:
push:
branches:
- master
jobs:
build-doc:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@main
- name: Install
run: |
sudo apt update
sudo apt install nodejs npm
sudo apt install texlive-latex-recommended texlive-fonts-recommended texlive-latex-extra
pip install --upgrade pip
pip install Sphinx
pip install sphinxcontrib-inlinesyntaxhighlight
pip install sphinx-sitemap
git clone https://github.com/FreeFem/FreeFem-parser-pygments.git ~/pygments
sudo cp ~/pygments/freefem.py /usr/lib/python3/dist-packages/pygments/lexers/
(cd /usr/lib/python3/dist-packages/pygments/lexers/ && sudo python _mapping.py)
sed -i 's/, BaseTranslator//g' /home/runner/.local/lib/python3.10/site-packages/sphinxcontrib/inlinesyntaxhighlight.py
sed -i "s/self.highlightlang/'python'/g" /home/runner/.local/lib/python3.10/site-packages/sphinxcontrib/inlinesyntaxhighlight.py
- name: Build PDF
run: |
make latex
(cd build/latex && pdflatex -halt-on-error -interaction=nonstopmode -jobname FreeFEM-documentation FreeFEM.tex && makeindex FreeFEM-documentation.idx && pdflatex -halt-on-error -interaction=nonstopmode -jobname FreeFEM-documentation FreeFEM.tex)
(cd build/latex && md5sum FreeFEM-documentation.pdf >> FreeFEM-documentation.pdf.md5)
- name: Build HTML
run: |
make clean
make html
echo "doc.freefem.org" > build/html/CNAME
echo "TODO: Remove the PDF from the website repository at the next FreeFem-source release"
mkdir build/html/pdf && cp build/latex/FreeFEM-documentation.pdf build/html/pdf/
(cd build/html/pdf && md5sum FreeFEM-documentation.pdf >> FreeFEM-documentation.pdf.md5)
- name: Deploy HTML
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: build/html
- name: Deploy PDF
uses: JamesIves/[email protected]
with:
branch: pdf
folder: build/latex