---
kind: pipeline
type: docker
name: default

steps:
  - name: buildlatex
    image: nareshkumarrao/texliveonfly
    commands:
      - tlmgr update --self --all
      - texliveonfly Main.tex 
      - biber main
      - texliveonfly Main.tex
      - biber main
      - texliveonfly Main.tex
  - name: gitea_release
    image: plugins/gitea-release
    settings:
      base_url: https://git.nareshkumarrao.com
      api_key:
        from_secret: gitea_token
      files: Main.pdf
    when:
      event: tag
  - name: pushftp
    image: cschlosser/drone-ftps
    environment:
      PLUGIN_HOSTNAME: nareshkumarrao.com:21
      FTP_USERNAME:
        from_secret: ftp_username
      FTP_PASSWORD:
        from_secret: ftp_password
      PLUGIN_SECURE: false
      PLUGIN_DEST_DIR: master_thesis
      PLUGIN_INCLUDE: ^Main.pdf$
    when:
      event: tag

trigger:
  event:
    - tag

