Skip to content
Snippets Groups Projects
Commit 6f429f7f authored by Jorge Moratinos's avatar Jorge Moratinos
Browse files

Update .gitlab-ci.yml

parent aaa2a3bd
No related branches found
No related tags found
No related merge requests found
Pipeline #7918 failed
# The Docker image that will be used to build your app
image: python:3.9.18-slim-bullseye
# Functions that should be executed before the build script is run
before_script:
- pip install -q mkdocs-material mike
- apt-get update -qq && apt-get -qq install -y git > /dev/null
- 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
pages: pages:
stage: deploy
image: python:3.9.18-slim-bullseye
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
PAGES_BRANCH: gl-pages
HTTPS_REMOTE: https://gitlab-ci-token:${ACCESS_TOKEN}@${CI_SERVER_HOST}/rep/${CI_PROJECT_PATH}.git
before_script:
- pip install -q mkdocs-material mike
- apt-get update -qq && apt-get -qq install -y git > /dev/null
- 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: script:
- | - '| if [ -n "$CI_COMMIT_TAG" ]; then mike deploy
if [ -n "$CI_COMMIT_TAG" ]; then --deploy-prefix public -r $HTTPS_REMOTE -p -b $PAGES_BRANCH -u
mike deploy --deploy-prefix public -r $HTTPS_REMOTE -p -b $PAGES_BRANCH -u $CI_COMMIT_TAG latest $CI_COMMIT_TAG latest mike set-default --deploy-prefix public -r
mike set-default --deploy-prefix public -r $HTTPS_REMOTE -p -b $PAGES_BRANCH latest $HTTPS_REMOTE -p -b $PAGES_BRANCH latest elif [
elif [ "$CI_COMMIT_REF_NAME" == "develop" ]; then "$CI_COMMIT_REF_NAME" == "develop" ]; then mike deploy
mike deploy --deploy-prefix public -r $HTTPS_REMOTE -p -b $PAGES_BRANCH -u $CI_COMMIT_BRANCH --deploy-prefix public -r $HTTPS_REMOTE -p -b $PAGES_BRANCH -u
fi $CI_COMMIT_BRANCH fi'
- git checkout $PAGES_BRANCH -- public/ - git checkout $PAGES_BRANCH -- public/
artifacts: artifacts:
paths: paths:
- public/ # The folder that contains the files to be exposed at the Page URL
- public
rules: rules:
- if: '$CI_COMMIT_TAG' # This ensures that only pushes to the default branch will trigger
- if: '$CI_COMMIT_REF_NAME == "develop"' # a pages deploy
when: always - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
- when: never
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment