Skip to content

Commit

Permalink
Merge pull request #5448 from kamilkrzyskow/update-workflows
Browse files Browse the repository at this point in the history
Fix GitHub Action caching methodology
  • Loading branch information
squidfunk authored May 2, 2023
2 parents 94a2920 + 739b8ab commit 3e27ceb
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 35 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ jobs:
uses: actions/cache@v3
id: cache
with:
key: ${{ runner.os }}-${{ hashFiles('.cache/**') }}
key: mkdocs-material-${{ github.sha }}
path: .cache
restore-keys: |
mkdocs-material-
- name: Install dependencies
run: sudo apt-get install pngquant
Expand Down
12 changes: 8 additions & 4 deletions docs/publishing-your-site.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ contents:
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
key: ${{ github.ref }}
key: mkdocs-material-${{ github.sha }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material # (3)!
- run: mkdocs gh-deploy --force
```
Expand Down Expand Up @@ -81,10 +83,12 @@ contents:
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
key: ${{ github.ref }}
key: mkdocs-material-${{ github.sha }}
path: .cache
restore-keys: |
mkdocs-material-
- run: apt-get install pngquant # (1)!
- run: pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
- run: mkdocs gh-deploy --force
Expand Down
32 changes: 17 additions & 15 deletions docs/setup/ensuring-data-privacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -484,27 +484,29 @@ carried out. You might want to:
`.cache` directory in between builds. Taking the example from the
[publishing guide], add the following lines:

``` yaml hl_lines="15-18"
``` yaml hl_lines="15-20"
name: ci
on:
push:
branches:
- master
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.x
- uses: actions/cache@v2
with:
key: ${{ github.ref }}
path: .cache
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ github.sha }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
```

[publishing guide]: ../publishing-your-site.md#with-github-actions
Expand Down
32 changes: 17 additions & 15 deletions docs/setup/setting-up-social-cards.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,27 +232,29 @@ whether the social cards need to be regenerated. You might want to:
`.cache` directory in between builds. Taking the example from the
[publishing guide], add the following lines:

``` yaml hl_lines="15-18"
``` yaml hl_lines="15-20"
name: ci
on:
push:
branches:
- master
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.x
- uses: actions/cache@v2
with:
key: ${{ github.ref }}
path: .cache
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ github.sha }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
```

[built-in social plugin]: #built-in-social-plugin
Expand Down

0 comments on commit 3e27ceb

Please sign in to comment.