language: scala

jdk:
  - oraclejdk8

stages:
  - name: test
  - name: release
    if: (branch = master AND type = push) OR (tag IS present)

jobs:
  include:
    - env: TEST="scalafmt"
      script: ./scalafmt --test
    - env: TEST="2.11"
      script: sbt ci-test
    - env: TEST="2.12"
      script: sbt ci-test
    - stage: release
      script: sbt ci-release
    - env:
        - GH_NAME=scalafmt-bot
        - GH_EMAIL=scalafmt-bot@scalameta.org
      stage: release
      script:
        - git config --global user.name "${GH_NAME}"
        - git config --global user.email "${GH_EMAIL}"
        - echo "machine github.com login ${GH_NAME} password ${GITHUB_DEPLOY_KEY}" > ~/.netrc
        - GIT_USER="${GH_NAME}" sbt docusaurusPublishGhpages

cache:
  directories:
    - $HOME/.sbt
    - $HOME/.ivy2/cache
    - $HOME/.coursier
    - target/repos

before_cache:
  - du -h -d 1 $HOME/.ivy2/cache
  - du -h -d 2 $HOME/.sbt/
  - find $HOME/.sbt -name "*.lock" -type f -delete
  - find $HOME/.ivy2/cache -name "ivydata-*.properties" -type f -delete
  - rm -rf $HOME/.ivy2/local

language: scala

jdk:
  - oraclejdk8

stages:
  - name: test
  - name: release
    if: (branch = master AND type = push) OR (tag IS present)

jobs:
  include:
    - env: TEST="scalafmt"
      script: ./scalafmt --test
    - env: TEST="2.11"
      script: sbt ci-test
    - env: TEST="2.12"
      script: sbt ci-test
    - stage: release
      script: sbt ci-release
    - env:
        - USER_EMAIL=olafurpg@gmail.com
      stage: release
      script: sbt docusaurusPublishGhpages

cache:
  directories:
    - $HOME/.sbt
    - $HOME/.ivy2/cache
    - $HOME/.coursier
    - target/repos

before_cache:
  - du -h -d 1 $HOME/.ivy2/cache
  - du -h -d 2 $HOME/.sbt/
  - find $HOME/.sbt -name "*.lock" -type f -delete
  - find $HOME/.ivy2/cache -name "ivydata-*.properties" -type f -delete
  - rm -rf $HOME/.ivy2/local

Fix CI for website publishing
Fix CI for website publishing
