image: veremes/sphinx-doc:latest

variables:
  S3_BUCKET_NAME_PROD: "documentation.veremes.net/vmap2"
  S3_BUCKET_NAME_DEV: "documentation-dev.veremes.net/vmap2"

# Deploiement documentation francaise en production
deploy-fr-prod:
  stage: deploy
  script:
  - sphinx-build -b html doc/source doc/build
  - aws s3 cp doc/build/ s3://$S3_BUCKET_NAME_PROD/ --recursive
  tags:
  - deployment
  - eslint
  - test
  only:
    refs:
    - master
    changes:
    - doc/source/**/*

# Deploiement documentation francaise en developpement
deploy-fr-dev:
  stage: deploy
  script:
  - sphinx-build -b html doc/source doc/build
  - aws s3 cp doc/build/ s3://$S3_BUCKET_NAME_DEV/ --recursive
  tags:
  - deployment
  - eslint
  - test
  only:
    refs:
    - next_version
    changes:
    - doc/source/**/*

