image: alpine:latest

workflow:
  rules:
    - if: $CI_COMMIT_BRANCH

deploy-docs:
  stage: deploy
  tags:
    - docker
  script:
    - mkdir -p public
    - cp -r src/* public/
    - sed -i "s/%%BRANCH%%/$CI_BRANCH_NAME/g" public/index.html
    - printenv
  artifacts:
    paths:
      - public/
  environment:
    name: $CI_COMMIT_BRANCH
    url: "https://$CI_PAGES_URL/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/index.html"
