From 6ed0203828cbabf7fb14b3c1f60c78754bd00363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Krzy=C5=9Bk=C3=B3w?= Date: Sun, 30 Apr 2023 22:21:56 +0200 Subject: [PATCH 1/4] Updated GitHub Actions versions in examples --- docs/publishing-your-site.md | 4 ++-- docs/setup/ensuring-data-privacy.md | 6 +++--- docs/setup/setting-up-social-cards.md | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/publishing-your-site.md b/docs/publishing-your-site.md index 8549c3bb8..43dd4725f 100644 --- a/docs/publishing-your-site.md +++ b/docs/publishing-your-site.md @@ -38,7 +38,7 @@ contents: - uses: actions/setup-python@v4 with: python-version: 3.x - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: key: ${{ github.ref }} path: .cache @@ -81,7 +81,7 @@ contents: - uses: actions/setup-python@v4 with: python-version: 3.x - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: key: ${{ github.ref }} path: .cache diff --git a/docs/setup/ensuring-data-privacy.md b/docs/setup/ensuring-data-privacy.md index 5f2417963..e71e2e1f4 100644 --- a/docs/setup/ensuring-data-privacy.md +++ b/docs/setup/ensuring-data-privacy.md @@ -495,11 +495,11 @@ carried out. You might want to: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 with: python-version: 3.x - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: key: ${{ github.ref }} path: .cache diff --git a/docs/setup/setting-up-social-cards.md b/docs/setup/setting-up-social-cards.md index 48ec14c59..25df723f6 100644 --- a/docs/setup/setting-up-social-cards.md +++ b/docs/setup/setting-up-social-cards.md @@ -244,11 +244,11 @@ whether the social cards need to be regenerated. You might want to: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 with: python-version: 3.x - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: key: ${{ github.ref }} path: .cache From c22d705826b169c218d93fc952d3e6a9e63606f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Krzy=C5=9Bk=C3=B3w?= Date: Sun, 30 Apr 2023 23:14:04 +0200 Subject: [PATCH 2/4] Updated GitHub Actions cache examples --- docs/publishing-your-site.md | 8 ++++++-- docs/setup/ensuring-data-privacy.md | 6 ++++-- docs/setup/setting-up-social-cards.md | 6 ++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/docs/publishing-your-site.md b/docs/publishing-your-site.md index 43dd4725f..81d0ca560 100644 --- a/docs/publishing-your-site.md +++ b/docs/publishing-your-site.md @@ -40,8 +40,10 @@ contents: python-version: 3.x - 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 ``` @@ -83,8 +85,10 @@ contents: python-version: 3.x - 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 diff --git a/docs/setup/ensuring-data-privacy.md b/docs/setup/ensuring-data-privacy.md index e71e2e1f4..cf039b004 100644 --- a/docs/setup/ensuring-data-privacy.md +++ b/docs/setup/ensuring-data-privacy.md @@ -484,7 +484,7 @@ 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: @@ -501,8 +501,10 @@ carried out. You might want to: python-version: 3.x - uses: actions/cache@v3 with: - key: ${{ github.ref }} + key: mkdocs-material-${{ github.sha }} path: .cache + restore-keys: | + mkdocs-material- - run: pip install mkdocs-material - run: mkdocs gh-deploy --force ``` diff --git a/docs/setup/setting-up-social-cards.md b/docs/setup/setting-up-social-cards.md index 25df723f6..6cb3e5f4d 100644 --- a/docs/setup/setting-up-social-cards.md +++ b/docs/setup/setting-up-social-cards.md @@ -233,7 +233,7 @@ 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: @@ -250,8 +250,10 @@ whether the social cards need to be regenerated. You might want to: python-version: 3.x - uses: actions/cache@v3 with: - key: ${{ github.ref }} + key: mkdocs-material-${{ github.sha }} path: .cache + restore-keys: | + mkdocs-material- - run: pip install mkdocs-material - run: mkdocs gh-deploy --force ``` From 293d92ebe70e8aa5ae55e4d59bf96546c304464a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Krzy=C5=9Bk=C3=B3w?= Date: Sun, 30 Apr 2023 23:24:52 +0200 Subject: [PATCH 3/4] Fixed indent in workflow file examples --- docs/setup/ensuring-data-privacy.md | 32 +++++++++++++-------------- docs/setup/setting-up-social-cards.md | 32 +++++++++++++-------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/docs/setup/ensuring-data-privacy.md b/docs/setup/ensuring-data-privacy.md index cf039b004..73fad6999 100644 --- a/docs/setup/ensuring-data-privacy.md +++ b/docs/setup/ensuring-data-privacy.md @@ -491,22 +491,22 @@ carried out. You might want to: branches: - master - main - 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 + 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 diff --git a/docs/setup/setting-up-social-cards.md b/docs/setup/setting-up-social-cards.md index 6cb3e5f4d..b81348eea 100644 --- a/docs/setup/setting-up-social-cards.md +++ b/docs/setup/setting-up-social-cards.md @@ -240,22 +240,22 @@ whether the social cards need to be regenerated. You might want to: branches: - master - main - 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 + 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 From 739b8abf2188afd1d82cb01b4b8e079447bc7f37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Krzy=C5=9Bk=C3=B3w?= Date: Sun, 30 Apr 2023 23:46:03 +0200 Subject: [PATCH 4/4] Fixed GitHub Action cache --- .github/workflows/documentation.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 4be118233..e3a6ded5c 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -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