pipeline:
  build:
    image: dockershelf/latex:full
    commands:
      # Add fonts
      - mv includes/fonts/* /usr/local/share/fonts/
      - chmod 644 /usr/local/share/fonts/*
      - fc-cache

      # Sort acronyms
      - sort includes/acronyms.tex -o includes/acronyms-sort.tex

      # Build pdf
      - xelatex main.tex
      - biber main
      - xelatex main.tex
      - xelatex main.tex

      # Rename main.pdf
      - mv main.pdf T2000_9829423_$(date +"%Y_%m_%d_%H_%M").pdf

  gitea_release:
    image: plugins/gitea-release
    settings:
      base_url:
        from_secret: base_url
      api_key:
        from_secret: api_key
      files: T2000_9829423_*.pdf
    when:
      event:
        - tag

branches: master
