Skip to content

Commit 3e27ceb

Browse files
authored
Merge pull request #5448 from kamilkrzyskow/update-workflows
Fix GitHub Action caching methodology
2 parents 94a2920 + 739b8ab commit 3e27ceb

File tree

4 files changed

+45
-35
lines changed

4 files changed

+45
-35
lines changed

.github/workflows/documentation.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ jobs:
5050
uses: actions/cache@v3
5151
id: cache
5252
with:
53-
key: ${{ runner.os }}-${{ hashFiles('.cache/**') }}
53+
key: mkdocs-material-${{ github.sha }}
5454
path: .cache
55+
restore-keys: |
56+
mkdocs-material-
5557
5658
- name: Install dependencies
5759
run: sudo apt-get install pngquant

docs/publishing-your-site.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ contents:
3838
- uses: actions/setup-python@v4
3939
with:
4040
python-version: 3.x
41-
- uses: actions/cache@v2
41+
- uses: actions/cache@v3
4242
with:
43-
key: ${{ github.ref }}
43+
key: mkdocs-material-${{ github.sha }}
4444
path: .cache
45+
restore-keys: |
46+
mkdocs-material-
4547
- run: pip install mkdocs-material # (3)!
4648
- run: mkdocs gh-deploy --force
4749
```
@@ -81,10 +83,12 @@ contents:
8183
- uses: actions/setup-python@v4
8284
with:
8385
python-version: 3.x
84-
- uses: actions/cache@v2
86+
- uses: actions/cache@v3
8587
with:
86-
key: ${{ github.ref }}
88+
key: mkdocs-material-${{ github.sha }}
8789
path: .cache
90+
restore-keys: |
91+
mkdocs-material-
8892
- run: apt-get install pngquant # (1)!
8993
- run: pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
9094
- run: mkdocs gh-deploy --force

docs/setup/ensuring-data-privacy.md

+17-15
Original file line numberDiff line numberDiff line change
@@ -484,27 +484,29 @@ carried out. You might want to:
484484
`.cache` directory in between builds. Taking the example from the
485485
[publishing guide], add the following lines:
486486

487-
``` yaml hl_lines="15-18"
487+
``` yaml hl_lines="15-20"
488488
name: ci
489489
on:
490490
push:
491491
branches:
492492
- master
493493
- main
494-
jobs:
495-
deploy:
496-
runs-on: ubuntu-latest
497-
steps:
498-
- uses: actions/checkout@v2
499-
- uses: actions/setup-python@v2
500-
with:
501-
python-version: 3.x
502-
- uses: actions/cache@v2
503-
with:
504-
key: ${{ github.ref }}
505-
path: .cache
506-
- run: pip install mkdocs-material
507-
- run: mkdocs gh-deploy --force
494+
jobs:
495+
deploy:
496+
runs-on: ubuntu-latest
497+
steps:
498+
- uses: actions/checkout@v3
499+
- uses: actions/setup-python@v4
500+
with:
501+
python-version: 3.x
502+
- uses: actions/cache@v3
503+
with:
504+
key: mkdocs-material-${{ github.sha }}
505+
path: .cache
506+
restore-keys: |
507+
mkdocs-material-
508+
- run: pip install mkdocs-material
509+
- run: mkdocs gh-deploy --force
508510
```
509511

510512
[publishing guide]: ../publishing-your-site.md#with-github-actions

docs/setup/setting-up-social-cards.md

+17-15
Original file line numberDiff line numberDiff line change
@@ -232,27 +232,29 @@ whether the social cards need to be regenerated. You might want to:
232232
`.cache` directory in between builds. Taking the example from the
233233
[publishing guide], add the following lines:
234234

235-
``` yaml hl_lines="15-18"
235+
``` yaml hl_lines="15-20"
236236
name: ci
237237
on:
238238
push:
239239
branches:
240240
- master
241241
- main
242-
jobs:
243-
deploy:
244-
runs-on: ubuntu-latest
245-
steps:
246-
- uses: actions/checkout@v2
247-
- uses: actions/setup-python@v2
248-
with:
249-
python-version: 3.x
250-
- uses: actions/cache@v2
251-
with:
252-
key: ${{ github.ref }}
253-
path: .cache
254-
- run: pip install mkdocs-material
255-
- run: mkdocs gh-deploy --force
242+
jobs:
243+
deploy:
244+
runs-on: ubuntu-latest
245+
steps:
246+
- uses: actions/checkout@v3
247+
- uses: actions/setup-python@v4
248+
with:
249+
python-version: 3.x
250+
- uses: actions/cache@v3
251+
with:
252+
key: mkdocs-material-${{ github.sha }}
253+
path: .cache
254+
restore-keys: |
255+
mkdocs-material-
256+
- run: pip install mkdocs-material
257+
- run: mkdocs gh-deploy --force
256258
```
257259

258260
[built-in social plugin]: #built-in-social-plugin

0 commit comments

Comments
 (0)