Commit d85586e2 authored by Julien Satti's avatar Julien Satti
Browse files

Update .gitlab-ci.yml file

parent 852a2afc
Loading
Loading
Loading
Loading
Loading
+4 −11
Original line number Diff line number Diff line
@@ -6,10 +6,10 @@ pages:
    PAGES_BRANCH: gl-pages
    HTTPS_REMOTE: https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/rep/${CI_PROJECT_PATH}.git
  before_script:
    - pip install -q mkdocs-material mike
    - pip install -q mkdocs-material mkdocs-glightbox mkdocs-markdownextradata-plugin mike 
    - apt-get update -qq && apt-get -qq install -y git > /dev/null
    - git config --global user.email "${GITLAB_USER_EMAIL}"
    - git config --global user.name "${GITLAB_USER_NAME}"
    - git config --global --replace-all user.name $GITLAB_USER_NAME
    - git config --global --replace-all user.email $GITLAB_USER_EMAIL
    - git fetch origin $PAGES_BRANCH && git checkout $PAGES_BRANCH || git checkout -b $PAGES_BRANCH origin/$PAGES_BRANCH || echo "Pages branch not deployed yet."
    - git checkout $CI_COMMIT_SHA
  script:
@@ -18,21 +18,14 @@ pages:
        mike deploy --deploy-prefix public -r $HTTPS_REMOTE -p -b $PAGES_BRANCH -u $CI_COMMIT_TAG latest
        mike set-default --deploy-prefix public -r $HTTPS_REMOTE -p -b $PAGES_BRANCH latest
      elif [ "$CI_COMMIT_REF_NAME" == "develop" ]; then
        mike deploy --deploy-prefix public -r $HTTPS_REMOTE -p -b $PAGES_BRANCH -u $CI_COMMIT_BRANCH latest
      elif [ -n "$CI_CLEAN" ]; then
        rm -rf public/$CI_CLEAN
        mike deploy --deploy-prefix public -r $HTTPS_REMOTE -p -b $PAGES_BRANCH -u $CI_COMMIT_BRANCH
      fi

    - git checkout $PAGES_BRANCH -- public/
  artifacts:
    paths:
      - public/
  rules:
    # This ensures that only pushes to the default branch will trigger
    # a pages deploy
    #- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
    - if: '$CI_COMMIT_TAG'
    - if: '$CI_COMMIT_REF_NAME == "main"'
    - if: '$CI_COMMIT_REF_NAME == "develop"'
      when: always
    - when: never
 No newline at end of file