From 3b6ae8e1e1896def885d17ff26ffbe299b570a64 Mon Sep 17 00:00:00 2001 From: Niclas Heinz Date: Tue, 4 Mar 2025 01:23:21 +0100 Subject: [PATCH] Documentation (#8058) * docs(publish your site): Add caching for gitlab pipeline * docs(publish your site): Add comments --- docs/publishing-your-site.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/publishing-your-site.md b/docs/publishing-your-site.md index f6f990ed4..2efff0fe8 100644 --- a/docs/publishing-your-site.md +++ b/docs/publishing-your-site.md @@ -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.