From 7c9f555170b3faf88722e81923770d406fa710ea Mon Sep 17 00:00:00 2001 From: Benno Lorenz Date: Fri, 13 Jun 2025 15:41:22 +0200 Subject: [PATCH] improved build caching --- .gitea/workflows/deploy.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index e3315be..5c43e74 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -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