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

steps:
- name: build
  image: jonasfranz/thesis:latest
  pull: 'always'
  commands:
  - make publish
  - cd presentation/
  - pdflatex presentation.tex
  - mv presentation.pdf koll.pdf

- name: upload
  image: curlimages/curl
  environment:
    WEBDAV_AUTH:
      from_secret: webdav_auth
  commands:
  - curl -T thesis.pdf -u "$WEBDAV_AUTH" https://cloud.jfdev.de/remote.php/dav/files/drone/Uploads/
  - curl -T presentation/koll.pdf -u "$WEBDAV_AUTH" https://cloud.jfdev.de/remote.php/dav/files/drone/Uploads/