name: Deploy
on:
push:
branches:
- main
paths:
- 'doc/**'
- '.github/workflows/docs.yml'
jobs:
build-doc:
name: Push documentation to website
if: github.repository == 'flintlib/flint'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: "Setup"
run: |
sudo apt-get install -y python3-sphinx
# See https://www.sphinx-doc.org/en/master/usage/builders/index.html#sphinx.builders.latex.LaTeXBuilder
sudo apt-get install -y texlive-latex-recommended texlive-fonts-recommended texlive-fonts-extra tex-gyre texlive-latex-extra latexmk
sphinx-build --version
- name: "Build documentation"
run: |
cd doc
make html SPHINXOPTS="-W -j auto"
- name: "Build PDF documentation"
run: |
cd doc
make latexpdf SPHINXOPTS="-W -j auto"
- name: "Create a tarball of the documentation"
run: |
cd doc/build
mv html doc
cp latex/flint.pdf doc
tar -czvf doc.tar.gz doc
- name: "Setup SSH key"
uses: shimataro/ssh-key-action@v2.7.0
with:
key: ${{ secrets.SSH_KEY }}
name: id_ed25519
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- name: "Push documentation to server"
run: |
cd doc/build
ssh -t wbhart@opal6.opalstack.com 'mkdir ~/tmp'
scp doc.tar.gz wbhart@opal6.opalstack.com:~/tmp
ssh -t wbhart@opal6.opalstack.com 'cd ~/tmp && tar -xf doc.tar.gz && rm -rf ~/apps/flintlib_org/doc && mv doc ~/apps/flintlib_org && cd ~ && rm -rf ~/tmp'