Commit f79ff6ae authored by Kostis Trantzas's avatar Kostis Trantzas
Browse files

mike plugin initial try at develop branch

parent 1499c530
Loading
Loading
Loading
Loading
Loading
+18 −5
Original line number Diff line number Diff line
pages:
  stage: deploy
  image: python:latest
  variables:
    PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
    PAGES_BRANCH: develop
    HTTPS_REMOTE: https://gitlab-ci-token:${ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git
  before_script:
    - pip install mkdocs-material mike
    - git config user.name $GITLAB_USER_NAME
    - git config user.email $GITLAB_USER_EMAIL
    - git fetch origin $PAGES_BRANCH && git -b checkout $PAGES_BRANCH origin/$PAGES_BRANCH || git checkout $PAGES_BRANCH || echo "Pages branch not deployed yet."
    - git checkout $CI_COMMIT_SHA
  script: 
    - pip install mkdocs-material
    - mkdocs build --site-dir public
    - mike deploy --rebase --prefix public -r $HTTPS_REMOTE -p -b $PAGES_BRANCH -u $CI_COMMIT_TAG latest
    - mike set-default --rebase --prefix public -r $HTTPS_REMOTE -p -b $PAGES_BRANCH latest
    - git checkout $PAGES_BRANCH -- public/
  artifacts:
    paths:
      - public
      - public/
  only:
    - tags
  rules:
    - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
    - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'