stages:
  - build
  - deploy
  - cleanup

image: sinex/docker-latex

variables:
  LATEX: pdflatex

build:
  stage: build
  script: make
  artifacts:
    name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
    when: always
    expire_in: 30 days
    paths:
    - build/

pdf:
  stage: deploy
  script: make pdf
  artifacts:
    name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
    paths:
    - Thesis.pdf
    - Thesis.tar.gz

cleanup:
  stage: cleanup
  script: make clean
  when: always