sudo: true
dist: bionic
language: python
cache: apt

addons:
  apt:
    packages:
      - tree
      - latexmk
      - biber
      - make

install:
    - pip install GitPython
      
script:
    - source ./.travis/get_build_repo_from_origin.sh
    - source ./.travis/travis_build.sh

deploy:
    - provider: pages
      skip-cleanup: true
      github-token: $GITHUB_TOKEN
      local-dir: build/
      keep-history: false
      on:
        branch: master
    - provider: releases
      api_key: $GITHUB_TOKEN
      skip_cleanup: true
      file: $TRAVIS_BUILD_DIR/build/LatexPackages.zip
      on:
          tags: true
    - provider: pages
      edge: true
      github-token: $GITHUB_TOKEN
      local-dir: build/LatexPackagesBuild
      repo: kesslermaximilian/LatexPackagesBuild
      commiter_from_gh: true
      allow_empty_commit: true
      target_branch: $TRAVIS_BRANCH-build
      commit_message: $COMMIT_MSG
      on:
          all_branches: true
          condition: $TRAVIS_PULL_REQUEST = false