1
Fork 0
mirror of https://github.com/Steffo99/sophon.git synced 2024-12-22 14:54:22 +00:00
sophon/.github/workflows/build-sphinx-report.yml

66 lines
2.1 KiB
YAML
Raw Normal View History

2021-11-17 19:38:49 +00:00
name: Build report document
on:
push:
branches: [ main ]
paths:
2021-11-21 00:06:24 +00:00
- ".github/workflows/build-sphinx-report.yml"
2021-11-17 19:38:49 +00:00
- "report/**"
jobs:
2021-11-21 00:06:24 +00:00
setup:
name: "Setup the environment"
2021-11-17 19:38:49 +00:00
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v2
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/
run: "poetry install --no-interaction"
html:
name: "Build HTML document"
needs: [ setup ]
runs-on: ubuntu-latest
steps:
- name: "Activate Python environment"
run: |
source $(poetry env list --full-path | cut -f1 -d" ")/bin/activate
2021-11-17 19:38:49 +00:00
- name: "Build HTML document with Sphinx"
uses: ammaraskar/sphinx-action@master
with:
docs-folder: "report/"
build-command: "make html"
- name: "Create a gzip of the build"
run: "tar -xvzf report/_build/report.html.tar.gz report/_build/html"
- name: "Upload build artifact"
uses: actions/upload-artifact@v2
with:
name: "report.html.tar.gz"
path: "report/_build/report.html.tar.gz"
latexpdf:
name: "Build PDF document"
2021-11-21 00:06:24 +00:00
needs: [ setup ]
2021-11-17 19:38:49 +00:00
runs-on: ubuntu-latest
steps:
2021-11-21 00:06:24 +00:00
- name: "Activate Python environment"
run: |
source $(poetry env list --full-path | cut -f1 -d" ")/bin/activate
- name: "Install Latex dependencies"
run: apt-get update -y && apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
2021-11-17 19:38:49 +00:00
- name: "Build Latex document with Sphinx"
uses: ammaraskar/sphinx-action@master
with:
docs-folder: "report/"
build-command: "make latexpdf"
- name: "Upload build artifact"
uses: actions/upload-artifact@v2
with:
name: "report.pdf"
path: "report/_build/latex/sophon.pdf"