changed caching method
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 41s

This commit is contained in:
2025-06-13 16:54:59 +02:00
parent 87f5a6dab8
commit 63474397b5

View File

@@ -7,6 +7,8 @@ on:
jobs: jobs:
build-and-deploy: build-and-deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
RUNNER_TOOL_CACHE: /toolcache
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
@@ -15,30 +17,30 @@ jobs:
fetch-depth: 0 fetch-depth: 0
# Cache the submodule content # Cache the submodule content
- name: Cache submodules #- name: Cache submodules
id: cache-submodules # id: cache-submodules
uses: actions/cache@v3 # uses: actions/cache@v3
with: # with:
path: | # path: |
.git/modules # .git/modules
themes/blowfish # themes/blowfish
key: ${{ runner.os }}-submodules-${{ hashFiles('.gitmodules') }} # key: ${{ runner.os }}-submodules-${{ hashFiles('.gitmodules') }}
restore-keys: | # restore-keys: |
${{ runner.os }}-submodules- # ${{ runner.os }}-submodules-
# Initialize submodules if cache miss # Initialize submodules if cache miss
- name: Initialize submodules - name: Initialize submodules
if: steps.cache-submodules.outputs.cache-hit != 'true' # if: steps.cache-submodules.outputs.cache-hit != 'true'
run: git submodule update --init --recursive run: git submodule update --init --recursive
# Cache Hugo dependencies and modules # Cache Hugo dependencies and modules
- name: Cache Hugo dependencies #- name: Cache Hugo dependencies
uses: actions/cache@v3 # uses: actions/cache@v3
with: # with:
path: /tmp/hugo_cache # path: /tmp/hugo_cache
key: ${{ runner.os }}-hugo-${{ hashFiles('**/go.sum') }} # key: ${{ runner.os }}-hugo-${{ hashFiles('**/go.sum') }}
restore-keys: | # restore-keys: |
${{ runner.os }}-hugo- # ${{ runner.os }}-hugo-
- name: Setup Hugo - name: Setup Hugo
uses: peaceiris/actions-hugo@v2 uses: peaceiris/actions-hugo@v2
@@ -47,25 +49,25 @@ jobs:
extended: true extended: true
# Cache resources but not public to prevent infinite loops # Cache resources but not public to prevent infinite loops
- name: Cache Hugo resources #- name: Cache Hugo resources
uses: actions/cache@v3 # uses: actions/cache@v3
with: # with:
path: resources/_gen # path: resources/_gen
key: ${{ runner.os }}-hugo-resources-${{ hashFiles('content/**', 'layouts/**', 'static/**', 'themes/**', 'config/**') }} # key: ${{ runner.os }}-hugo-resources-${{ hashFiles('content/**', 'layouts/**', 'static/**', 'themes/**', 'config/**') }}
restore-keys: | # restore-keys: |
${{ runner.os }}-hugo-resources- # ${{ runner.os }}-hugo-resources-
- name: Build - name: Build
run: hugo --minify --buildFuture run: hugo --minify --buildFuture
# Cache apt packages # Cache apt packages
- name: Cache apt packages #- name: Cache apt packages
uses: actions/cache@v3 # uses: actions/cache@v3
with: # with:
path: /var/cache/apt/archives # path: /var/cache/apt/archives
key: ${{ runner.os }}-apt-${{ hashFiles('**/deploy.yml') }} # key: ${{ runner.os }}-apt-${{ hashFiles('**/deploy.yml') }}
restore-keys: | # restore-keys: |
${{ runner.os }}-apt- # ${{ runner.os }}-apt-
- name: Install rsync - name: Install rsync
run: sudo apt-get update && sudo apt-get install -y rsync run: sudo apt-get update && sudo apt-get install -y rsync