webgl:
  image: cafstep/unity-ci:latest
  stage: build
  script:
    - ./build-ci.sh $UNITY_LICENSE
  artifacts:
    paths:
      - ./Builds
  cache:
    paths:
      - Packages/
  only:
    - master
    - /^week\d+$/
    - /^test\d+$/
  tags:
    - riganti
  variables:
    GIT_SUBMODULE_STRATEGY: recursive

scp-aisa:
  image: ubuntu:latest
  stage: deploy
  script:
    - apt-get update
    - apt-get -y install openssh-client
    - mkdir ~/.ssh
    - touch ~/.ssh/known_hosts
    - echo "$AISA_KNOWN_HOST" >> ~/.ssh/known_hosts
    - chmod 600 "$AISA_KEY"
    - LATEST_TAG=$(git describe --tags --abbrev=0)
    - ssh -i "$AISA_KEY" "xstepan1@aisa.fi.muni.cz" "rm -rf ~/public_html/pv255/$LATEST_TAG"
    - scp -i "$AISA_KEY" -r Builds/* "xstepan1@aisa.fi.muni.cz:public_html/pv255/$LATEST_TAG"
  variables:
    GIT_STRATEGY: none
  resource_group: deploy
  only:
    - /^week\d+$/
    - /^test\d+$/
  tags:
    - riganti
