Document the XDG_CACHE_HOME environment variable (#324)

This commit is contained in:
Louis 2022-02-23 23:34:09 +01:00 committed by GitHub
parent e62f6be0fc
commit 99660e8645
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 0 deletions

View File

@ -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 Whenever you commit to the repository now, GitLab will automatically start
a job on the public infrastructure and deploy your website. 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 ## CNAME Support
If you want to use a [CNAME :ext](https://en.wikipedia.org/wiki/CNAME) with If you want to use a [CNAME :ext](https://en.wikipedia.org/wiki/CNAME) with

View File

@ -127,6 +127,10 @@ deploy:
script: "lektor deploy ghpages" 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 ## Restricting Branches
If you plan on having different branches and contributors you should disable If you plan on having different branches and contributors you should disable