diff --git a/content/docs/deployment/glpages/contents.lr b/content/docs/deployment/glpages/contents.lr index a3c5d459..6105aa2b 100644 --- a/content/docs/deployment/glpages/contents.lr +++ b/content/docs/deployment/glpages/contents.lr @@ -52,6 +52,39 @@ just name the branch differently and adjust the `only` entry. Whenever you commit to the repository now, GitLab will automatically start a job on the public infrastructure and deploy your website. +## Cache directory + +You can enable caching to reuse build results between compilation. +To do so, you have to: + +- set the cache directory using the environment variable `XDG_CACHE_HOME`; +- configure Gitlab to cache this directory. + +See the example below. + +```yaml +image: python:latest + +default: + cache: + paths: + - .cache/lektor + - .cache/pip + +variables: + XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache" + +pages: + script: + - pip install lektor + - lektor build --output-path public + artifacts: + paths: + - public + only: + - master +``` + ## CNAME Support If you want to use a [CNAME :ext](https://en.wikipedia.org/wiki/CNAME) with diff --git a/content/docs/deployment/travisci/contents.lr b/content/docs/deployment/travisci/contents.lr index ea85d6bf..cce10fe8 100644 --- a/content/docs/deployment/travisci/contents.lr +++ b/content/docs/deployment/travisci/contents.lr @@ -127,6 +127,10 @@ deploy: script: "lektor deploy ghpages" ``` +Note that it is also possible to set the cache directory of Lektor using the +environment variable `XDG_CACHE_HOME`, and cache this directory instead, +as done with [Gitlab pages](../glpages/). + ## Restricting Branches If you plan on having different branches and contributors you should disable