mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-22 06:44:21 +00:00
73 lines
2.5 KiB
YAML
73 lines
2.5 KiB
YAML
name: Build thesis document
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
paths:
|
|
- ".github/workflows/build-sphinx-thesis.yml"
|
|
- "thesis/**"
|
|
- "backend/**"
|
|
jobs:
|
|
html:
|
|
name: "Build HTML document"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: "Checkout repository"
|
|
uses: actions/checkout@v2
|
|
- name: "Setup Python"
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.9
|
|
- name: "Setup Poetry"
|
|
uses: abatilo/actions-poetry@v2.0.0
|
|
with:
|
|
poetry-version: 1.1.11
|
|
- name: "Install backend dependencies"
|
|
working-directory: backend/
|
|
run: poetry install --no-interaction
|
|
- name: "Find Poetry Python environment"
|
|
working-directory: backend/
|
|
run: echo "pythonLocation=$(poetry env list --full-path | cut -f1 -d' ')/bin" >> $GITHUB_ENV
|
|
- name: "Build HTML document with Sphinx"
|
|
working-directory: thesis/
|
|
run: |
|
|
source $pythonLocation/activate
|
|
make html
|
|
- name: "Create a gzip of the build"
|
|
run: "tar -xvzf thesis/_build/thesis.html.tar.gz thesis/_build/html"
|
|
- name: "Upload build artifact"
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: "thesis.html.tar.gz"
|
|
path: "thesis/_build/thesis.html.tar.gz"
|
|
latexpdf:
|
|
name: "Build PDF document"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: "Checkout repository"
|
|
uses: actions/checkout@v2
|
|
- name: "Setup Python"
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.9
|
|
- name: "Setup Poetry"
|
|
uses: abatilo/actions-poetry@v2.0.0
|
|
with:
|
|
poetry-version: 1.1.11
|
|
- name: "Install backend dependencies"
|
|
working-directory: backend/
|
|
run: poetry install --no-interaction
|
|
- name: "Find Poetry Python environment"
|
|
working-directory: backend/
|
|
run: echo "pythonLocation=$(poetry env list --full-path | cut -f1 -d' ')/bin" >> $GITHUB_ENV
|
|
- name: "Install LaTeX dependencies"
|
|
run: apt-get update -y && apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
|
|
- name: "Build LaTeX document with Sphinx"
|
|
working-directory: thesis/
|
|
run: |
|
|
source $pythonLocation/activate
|
|
make latexpdf
|
|
- name: "Upload build artifact"
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: "thesis.pdf"
|
|
path: "thesis/_build/latex/sophon.pdf"
|