Skip to content

Instantly share code, notes, and snippets.

@Himura2la
Last active April 28, 2024 08:36
Show Gist options
  • Save Himura2la/dc054311c96d2737f11dbef6880b61b8 to your computer and use it in GitHub Desktop.
Save Himura2la/dc054311c96d2737f11dbef6880b61b8 to your computer and use it in GitHub Desktop.
MkDocs with plugins in GitLab CI (with apk and pip packages caching)
image: python:alpine
variables:
PIP_CACHE_DIR: $CI_PROJECT_DIR/.cache/pip
APK_CACHE_DIR: $CI_PROJECT_DIR/.cache/apk
PIP_PACKAGES:
mkdocs
mkdocs-material
mkdocs-git-revision-date-localized-plugin
cache:
paths:
- $PIP_CACHE_DIR
- $APK_CACHE_DIR
update_mkdocs:
only: [ schedules ]
script:
- apk update
- apk add --no-cache gcc musl-dev
- pip install --upgrade $PIP_PACKAGES
- mkdir -p $APK_CACHE_DIR
- apk add --cache-dir $APK_CACHE_DIR git
pages:
only: [ master ]
except: [ schedules ]
before_script:
- apk update --cache-dir $APK_CACHE_DIR
- apk add --cache-dir $APK_CACHE_DIR git
- pip install $PIP_PACKAGES
script:
- mkdocs build -d public
artifacts:
paths:
- public
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment