2021-11-17 19:38:31 +00:00
name : Build thesis document
on :
push :
branches : [ main ]
paths :
2021-11-21 00:06:24 +00:00
- ".github/workflows/build-sphinx-thesis.yml"
2021-11-17 19:38:31 +00:00
- "thesis/**"
2021-11-21 04:09:20 +00:00
- "backend/**"
2021-11-17 19:38:31 +00:00
jobs :
2021-11-21 00:10:15 +00:00
html :
name : "Build HTML document"
2021-11-17 19:38:31 +00:00
runs-on : ubuntu-latest
steps :
- name : "Checkout repository"
uses : actions/checkout@v2
2021-11-21 05:15:56 +00:00
with :
lfs : true
- name : "Checkout LFS objects"
run : git lfs checkout
2021-11-21 00:06:24 +00:00
- 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/
2021-11-21 04:16:21 +00:00
run : poetry install --no-interaction
2021-11-21 04:07:26 +00:00
- name : "Find Poetry Python environment"
2021-11-21 04:10:42 +00:00
working-directory : backend/
2021-11-21 04:07:26 +00:00
run : echo "pythonLocation=$(poetry env list --full-path | cut -f1 -d' ')/bin" >> $GITHUB_ENV
2021-11-17 19:38:31 +00:00
- name : "Build HTML document with Sphinx"
2021-11-21 04:16:21 +00:00
working-directory : thesis/
2021-11-21 04:22:41 +00:00
run : |
source $pythonLocation/activate
make html
2021-11-21 04:38:31 +00:00
- name : "Create a gzipped tarball of the build"
2021-11-21 04:47:27 +00:00
working-directory : ${{ github.workspace }}
2021-11-21 04:49:41 +00:00
run : tar -cvzf thesis/build/thesis.html.tar.gz thesis/build/html
2021-11-17 19:38:31 +00:00
- name : "Upload build artifact"
uses : actions/upload-artifact@v2
with :
name : "thesis.html.tar.gz"
2021-11-21 04:38:31 +00:00
path : "thesis/build/thesis.html.tar.gz"
2021-12-14 13:00:18 +00:00
- name : "Publish build to GitHub Pages"
uses : peaceiris/actions-gh-pages@v3.7.3
with :
github_token : ${{ secrets.GITHUB_TOKEN }}
publish_dir : thesis/build/html/
enable_jekyll : false
2021-11-17 19:38:31 +00:00
latexpdf :
name : "Build PDF document"
runs-on : ubuntu-latest
steps :
2021-11-21 04:33:18 +00:00
- name : "Update apt repositories"
run : sudo apt-get update -y
2021-11-21 00:10:15 +00:00
- name : "Checkout repository"
uses : actions/checkout@v2
2021-11-21 05:15:56 +00:00
with :
lfs : true
- name : "Checkout LFS objects"
run : git lfs checkout
2021-11-21 00:10:15 +00:00
- 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
2021-11-21 04:33:18 +00:00
- name : "Install LaTeX packages"
2021-11-21 05:24:22 +00:00
run : sudo apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-luatex fonts-ebgaramond fonts-ebgaramond-extra fonts-firacode xindy
2021-11-21 00:10:15 +00:00
- name : "Install backend dependencies"
working-directory : backend/
2021-11-21 04:07:26 +00:00
run : poetry install --no-interaction
- name : "Find Poetry Python environment"
2021-11-21 04:10:42 +00:00
working-directory : backend/
2021-11-21 04:07:26 +00:00
run : echo "pythonLocation=$(poetry env list --full-path | cut -f1 -d' ')/bin" >> $GITHUB_ENV
2021-11-21 04:25:41 +00:00
- name : "Build LaTeX document with Sphinx"
2021-11-21 04:16:21 +00:00
working-directory : thesis/
2021-11-21 04:22:41 +00:00
run : |
source $pythonLocation/activate
2021-11-30 16:59:02 +00:00
make latex
2021-11-30 18:10:55 +00:00
- name : "Remove numbering from subsections"
working-directory : thesis/build/latex/
2021-12-02 16:45:11 +00:00
run : sed --regexp-extended --in-place 's/[\]subsection[{]/\\subsection*{/g' progettazioneesviluppodisophonapplicativocloudasupportodellaricerca.tex
2021-11-30 18:04:11 +00:00
- name : "Remove numbering from subsubsections"
2021-11-30 17:06:25 +00:00
working-directory : thesis/build/latex/
2021-12-02 16:45:11 +00:00
run : sed --regexp-extended --in-place 's/[\]subsubsection[{]/\\subsubsection*{/g' progettazioneesviluppodisophonapplicativocloudasupportodellaricerca.tex
2021-11-30 18:04:11 +00:00
- name : "Remove numbering from paragraphs"
working-directory : thesis/build/latex/
2021-12-02 16:45:11 +00:00
run : sed --regexp-extended --in-place 's/[\]paragraph[{]/\\paragraph*{/g' progettazioneesviluppodisophonapplicativocloudasupportodellaricerca.tex
2021-11-30 18:04:11 +00:00
- name : "Remove numbering from subparagraphs"
working-directory : thesis/build/latex/
2021-12-02 16:45:11 +00:00
run : sed --regexp-extended --in-place 's/[\]subparagraph[{]/\\subparagraph*{/g' progettazioneesviluppodisophonapplicativocloudasupportodellaricerca.tex
2021-12-02 16:02:31 +00:00
- name : "Add appendix macro"
working-directory : thesis/build/latex/
2021-12-02 16:45:11 +00:00
run : sed --regexp-extended --in-place 's/[\]chapter[{]Installazione di Sophon[}]/\\appendix\\chapter{Installazione di Sophon}/g' progettazioneesviluppodisophonapplicativocloudasupportodellaricerca.tex
2021-12-02 16:40:21 +00:00
- name : "Remove autogenerated indexes"
working-directory : thesis/
run : python latex_index_remover.py
2021-11-30 16:59:02 +00:00
- name : "Build PDF document with Latexmk"
working-directory : thesis/build/latex/
run : make
2021-11-17 19:38:31 +00:00
- name : "Upload build artifact"
uses : actions/upload-artifact@v2
with :
name : "thesis.pdf"
2021-11-21 05:27:58 +00:00
path : "thesis/build/latex/progettazioneesviluppodisophonapplicativocloudasupportodellaricerca.pdf"