variables:
  GIT_SUBMODULE_STRATEGY: recursive

before_script:
  - module load singularity/3.0.2
  - module load awscli

stages:
  - build_stage
  - deploy_stage

build:
  stage: build_stage
  script:
  - singularity run 'docker://monachus/hugo' hugo
  artifacts:
    paths:
    - public/
    expire_in: 1 week
  cache:
    paths:
    - public/

deploy.dev:
  stage: deploy_stage
  script:
  - singularity run 'docker://monachus/hugo' hugo deploy aws-dev --maxDeletes -1
  dependencies:
  - build
  only:
  - develop

deploy.live:
  stage: deploy_stage
  script:
  - singularity run 'docker://monachus/hugo' hugo deploy aws --maxDeletes -1
  dependencies:
  - build
  only:
  - master