deploy-web:
  only:
    - master
    - deploy
  image: node:latest
  script:
    - cd app && yarn && yarn build && cd ..
    # node:latest doesn't come with rsync
    - rm -rf /deployment/*
    - cp -aR app/dist/* /deployment/
  artifacts:
    paths:
      - app/dist
  tags:
    - toi

deploy-api:
    only:
      - master
      - deploy
    script:
      - mkdir -p /var/www/iihf/api && cp Dockerfile docker-compose.yml /var/www/iihf/api/ && rsync api /var/www/iihf/api/ --delete-before --recursive && cd /var/www/iihf/api/
      # Should probably usre gitlab's container registry, but it's not set up on this instance.
      - docker-compose build
      - docker-compose down
      - docker-compose up -d
    tags:
      - toiapi

