Documentation (#8058)

* docs(publish your site): Add caching for gitlab pipeline

* docs(publish your site): Add comments
This commit is contained in:
Niclas Heinz
2025-03-04 01:23:21 +01:00
committed by GitHub
parent 85ac2144f5
commit 3b6ae8e1e1

View File

@@ -181,13 +181,21 @@ contents:
script:
- pip install mkdocs-material
- mkdocs build --site-dir public
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- .cache/ # (1)!
artifacts:
paths:
- public
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
```
1. Some Material for MkDocs plugins use [caching] to speed up repeated
builds, and store the results in the `.cache` directory.
=== "Insiders"
``` yaml
@@ -197,6 +205,10 @@ contents:
script: # (1)!
- pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
- mkdocs build --site-dir public
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- .cache/ # (2)!
artifacts:
paths:
- public
@@ -208,6 +220,9 @@ contents:
[personal access token] when deploying [Insiders], which can be done
using [masked custom variables].
2. Some Material for MkDocs plugins use [caching] to speed up repeated
builds, and store the results in the `.cache` directory.
Now, when a new commit is pushed to the [default branch] (typically `master` or
`main`), the static site is automatically built and deployed. Commit and push
the file to your repository to see the workflow in action.