stages:
  - build
  - deploy

Build:
  stage: build
  tags:
    - default
  script:
    - export WORKDIR=$(php /usr/local/bin/volume.php | cut -d":" -f 1)/devops-tools/documentation
    - echo "WorkDir is ${WORKDIR}"
    - docker-compose up -d
    - sleep 20
    - docker-compose exec -T --workdir=/mkdocs mkdocs mkdocs build
    - docker-compose down
  artifacts:
    name: build
    when: always
    paths:
      - site/

Deploy:
  stage: deploy
  tags:
    - ansible
  variables:
    GIT_STRATEGY: none
  script:
    - echo "Coming later ${PWD}"
    - a -m copy -a "src=${PWD}/site/ dest=/var/www/docs/devops-tools" --limit=bsdevop1
  cache: {}
