Skip to content

Commit a26863a

Browse files
committed
Clarify
1 parent 9c8ff64 commit a26863a

File tree

1 file changed

+1
-102
lines changed

1 file changed

+1
-102
lines changed

docs/setup/adding-a-git-repository.md

+1-102
Original file line numberDiff line numberDiff line change
@@ -230,108 +230,7 @@ The following configuration options are supported:
230230
```
231231

232232
!!! note
233-
If you are deploying through a CI system, please do the CI configuration as described in the [git-revision-date-localized](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin#note-when-using-build-environments) documentation.
234-
235-
[With Github Actions](../publishing-your-site.md#with-github-actions):
236-
237-
=== "Material for MkDocs"
238-
239-
``` yaml hl_lines="14 15"
240-
name: ci # (1)!
241-
on:
242-
push:
243-
branches:
244-
- master # (2)!
245-
- main
246-
permissions:
247-
contents: write
248-
jobs:
249-
deploy:
250-
runs-on: ubuntu-latest
251-
steps:
252-
- uses: actions/checkout@v3
253-
with:
254-
fetch-depth: 0
255-
- uses: actions/setup-python@v4
256-
with:
257-
python-version: 3.x
258-
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV # (3)!
259-
- uses: actions/cache@v3
260-
with:
261-
key: mkdocs-material-${{ env.cache_id }}
262-
path: .cache
263-
restore-keys: |
264-
mkdocs-material-
265-
- run: pip install mkdocs-material # (4)!
266-
- run: mkdocs gh-deploy --force
267-
```
268-
269-
1. You can change the name to your liking.
270-
271-
2. At some point, GitHub renamed `master` to `main`. If your default branch
272-
is named `master`, you can safely remove `main`, vice versa.
273-
274-
3. Store the `cache_id` environmental variable to access it later during cache
275-
`key` creation. The name is case-sensitive, so be sure to align it with `${{ env.cache_id }}`.
276-
277-
- The `--utc` option makes sure that each workflow runner uses the same time zone.
278-
- The `%V` format assures a cache update once a week.
279-
- You can change the format to `%F` to have daily cache updates.
280-
281-
You can read the [manual page] to learn more about the formatting options of the `date` command.
282-
283-
4. This is the place to install further [MkDocs plugins] or Markdown
284-
extensions with `pip` to be used during the build:
285-
286-
``` sh
287-
pip install \
288-
mkdocs-material \
289-
mkdocs-awesome-pages-plugin \
290-
...
291-
```
292-
293-
=== "Insiders"
294-
295-
``` yaml hl_lines="15 16"
296-
name: ci
297-
on:
298-
push:
299-
branches:
300-
- master
301-
- main
302-
permissions:
303-
contents: write
304-
jobs:
305-
deploy:
306-
runs-on: ubuntu-latest
307-
if: github.event.repository.fork == false
308-
steps:
309-
- uses: actions/checkout@v3
310-
with:
311-
fetch-depth: 0
312-
- uses: actions/setup-python@v4
313-
with:
314-
python-version: 3.x
315-
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
316-
- uses: actions/cache@v3
317-
with:
318-
key: mkdocs-material-${{ env.cache_id }}
319-
path: .cache
320-
restore-keys: |
321-
mkdocs-material-
322-
- run: apt-get install pngquant # (1)!
323-
- run: pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
324-
- run: mkdocs gh-deploy --force
325-
env:
326-
GH_TOKEN: ${{ secrets.GH_TOKEN }} # (2)!
327-
```
328-
329-
1. This step is only necessary if you want to use the
330-
[built-in optimize plugin] to automatically compress images.
331-
332-
2. Remember to set the `GH_TOKEN` environment variable to the value of your
333-
[personal access token] when deploying [Insiders], which can be done
334-
using [GitHub secrets].
233+
If you are deploying through a CI system, you might need to adjust your CI settings when fetching the code. For more information, see [git-revision-date-localized](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin#note-when-using-build-environments).
335234

336235
[`fallback_to_build_date`](#+git-revision-date-localized.fallback_to_build_date){ #+git-revision-date-localized.fallback_to_build_date }
337236

0 commit comments

Comments
 (0)