improved build caching

This commit is contained in:
2025-06-13 15:41:22 +02:00
parent 47a0503a54
commit 7c9f555170

View File

@@ -14,15 +14,44 @@ jobs:
submodules: true
fetch-depth: 0
# Cache Hugo dependencies and modules
- name: Cache Hugo dependencies
uses: actions/cache@v3
with:
path: /tmp/hugo_cache
key: ${{ runner.os }}-hugo-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-hugo-
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "latest"
extended: true
# Cache the Hugo build output
- name: Cache Hugo build
uses: actions/cache@v3
with:
path: |
public
resources/_gen
key: ${{ runner.os }}-hugo-build-${{ hashFiles('content/**', 'layouts/**', 'static/**', 'themes/**', 'config/**') }}
restore-keys: |
${{ runner.os }}-hugo-build-
- name: Build
run: hugo --minify --buildFuture
# Cache apt packages
- name: Cache apt packages
uses: actions/cache@v3
with:
path: /var/cache/apt/archives
key: ${{ runner.os }}-apt-${{ hashFiles('**/deploy.yml') }}
restore-keys: |
${{ runner.os }}-apt-
- name: Install rsync
run: sudo apt-get update && sudo apt-get install -y rsync