stages:
  - build
  - deploy

.build: &build
  stage: build
  script: 
    - cd docs
    - make html
  artifacts:
    paths:
      - docs/build/html

build:docker:
  <<: *build
  tags: 
    - docker
  image: sphinxdoc/sphinx
  needs: [ ]

.deploy: &deploy
  stage: deploy
  script:
    - cp -rv docs/build/html/* ${DEPLOY_PATH}

deploy:prod:
  <<: *deploy
  tags:
    - caesarvm
  only:
    - main
  needs: [ "build:docker" ]
  variables: 
    DEPLOY_PATH: "/app/wiki/docs/build/html"
    GIT_STRATEGY: clone