stages:
  - build

build:
  stage: build
  image: texlive/texlive@sha256:70fdbc1d9596c8eeb4a80c71a8eb3a5aeb63bed784112cbdb87f740e28de7a80
  script:
    - echo -e "section_start:`date +%s`:rebuild_fc_cache\r\e[0KRebuild Fontconfig cache (docker image bug)"
    - cp $(kpsewhich -var-value TEXMFSYSVAR)/fonts/conf/texlive-fontconfig.conf /etc/fonts/conf.d/09-texlive.conf
    - fc-cache -sv
    - echo -e "section_end:`date +%s`:rebuild_fc_cache\r\e[0K"
    - echo -e "section_start:`date +%s`:build\r\e[0KBuild the project proper"
    - latexmk -jobname="manuale-italiano"
    - mv build/manuale-italiano.pdf .
    - echo -e "section_end:`date +%s`:build\r\e[0K"
  artifacts:
    expire_in: 30 days
    paths:
      - ./manuale-italiano.pdf
