From c23fbdfc843eb9cd29298696b29a410def5e915d Mon Sep 17 00:00:00 2001 From: squidfunk Date: Fri, 22 Sep 2023 18:30:39 +0200 Subject: [PATCH] Improve GitHub Actions workflows --- .github/workflows/build.yml | 1 + .github/workflows/documentation.yml | 26 +++++++++++--------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3dabde071..23b0bb1cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,6 +78,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ env.PYTHON_VERSION }} + cache: pip - name: Set up Python dependencies run: pip install --upgrade build twine diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 8fca7b29f..e793e7eb9 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -45,15 +45,12 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ env.PYTHON_VERSION }} - - - name: Set the date environmental variable - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + cache: pip - name: Set up build cache - uses: actions/cache@v3 - id: cache + uses: actions/cache/restore@v3 with: - key: mkdocs-material-${{ env.cache_id }} + key: mkdocs-material- path: .cache restore-keys: | mkdocs-material- @@ -63,15 +60,8 @@ jobs: - name: Install Python dependencies run: | - pip install \ - "cairosvg>=2.5" \ - "mkdocs-git-committers-plugin-2>=1.1.1" \ - "mkdocs-git-revision-date-localized-plugin>=1.0" \ - "mkdocs-minify-plugin>=0.3" \ - "mkdocs-rss-plugin>=1.2" \ - "mkdocs-redirects>=1.0" \ - "lxml" \ - "pillow<10" + pip install mkdocs-material + pip install mkdocs-material[recommended,git,imaging] - name: Install Insiders build if: github.event.repository.fork == false @@ -95,3 +85,9 @@ jobs: run: | mkdocs gh-deploy --force mkdocs --version + + - name: Save build cache + uses: actions/cache/save@v3 + with: + key: mkdocs-material-${{ hashfiles('.cache/**') }} + path: .cache