image: alpine:latest

workflow:
  rules:
    - if: $CI_COMMIT_BRANCH

deploy-docs:
  stage: deploy
  tags:
    - docker
  script:
    - sed -i "s/%%BRANCH%%/$CI_COMMIT_BRANCH/g" src/index.html
    - mv src public
  artifacts:
    paths:
      - public/
  environment:
    name: $CI_COMMIT_BRANCH
    url: "https://$CI_PROJECT_NAMESPACE.$CI_PAGES_DOMAIN/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/index.html"
