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.