From 83639ac94d407d288c42e20d2b1c980d5750dd7a Mon Sep 17 00:00:00 2001 From: Benno Lorenz Date: Tue, 17 Jun 2025 23:36:54 +0200 Subject: [PATCH 1/4] replaced hashing function for caching --- .gitea/workflows/deploy.yml | 42 +++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 47ec5e3..a180e28 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -16,6 +16,17 @@ jobs: submodules: false # Don't fetch submodules yet fetch-depth: 0 + # Setup Go for the go-hashfiles action + - uses: actions/setup-go@v3 + with: + go-version: '1.20' + + # Generate hash for submodules + - uses: actions/go-hashfiles@v0.0.1 + id: submodules-hash + with: + patterns: .gitmodules + # Cache the submodule content - name: Cache submodules id: cache-submodules @@ -24,7 +35,7 @@ jobs: path: | .git/modules themes/blowfish - key: ${{ runner.os }}-submodules-${{ hashFiles('.gitmodules') }} + key: ${{ runner.os }}-submodules-${{ steps.submodules-hash.outputs.hash }} restore-keys: | ${{ runner.os }}-submodules- @@ -33,12 +44,18 @@ jobs: if: steps.cache-submodules.outputs.cache-hit != 'true' run: git submodule update --init --recursive + # Generate hash for Hugo dependencies + - uses: actions/go-hashfiles@v0.0.1 + id: hugo-deps-hash + with: + patterns: '**/go.sum' + # 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') }} + key: ${{ runner.os }}-hugo-${{ steps.hugo-deps-hash.outputs.hash }} restore-keys: | ${{ runner.os }}-hugo- @@ -48,24 +65,41 @@ jobs: hugo-version: "latest" extended: true + # Generate hash for Hugo resources + - uses: actions/go-hashfiles@v0.0.1 + id: hugo-resources-hash + with: + patterns: |- + content/** + layouts/** + static/** + themes/** + config/** + # Cache resources but not public to prevent infinite loops - name: Cache Hugo resources uses: actions/cache@v3 with: path: resources/_gen - key: ${{ runner.os }}-hugo-resources-${{ hashFiles('content/**', 'layouts/**', 'static/**', 'themes/**', 'config/**') }} + key: ${{ runner.os }}-hugo-resources-${{ steps.hugo-resources-hash.outputs.hash }} restore-keys: | ${{ runner.os }}-hugo-resources- - name: Build run: hugo --minify --buildFuture + # Generate hash for apt cache + - uses: actions/go-hashfiles@v0.0.1 + id: apt-hash + with: + patterns: '**/deploy.yml' + # Cache apt packages - name: Cache apt packages uses: actions/cache@v3 with: path: /var/cache/apt/archives - key: ${{ runner.os }}-apt-${{ hashFiles('**/deploy.yml') }} + key: ${{ runner.os }}-apt-${{ steps.apt-hash.outputs.hash }} restore-keys: | ${{ runner.os }}-apt- From e5884ee89780c64d8e925be4fd609d217287704e Mon Sep 17 00:00:00 2001 From: Benno Lorenz Date: Tue, 17 Jun 2025 23:39:15 +0200 Subject: [PATCH 2/4] repointed link --- .gitea/workflows/deploy.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index a180e28..ff75a86 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -22,7 +22,7 @@ jobs: go-version: '1.20' # Generate hash for submodules - - uses: actions/go-hashfiles@v0.0.1 + - uses: https://gitea.com/actions/go-hashfiles@v0.0.1 id: submodules-hash with: patterns: .gitmodules @@ -45,7 +45,7 @@ jobs: run: git submodule update --init --recursive # Generate hash for Hugo dependencies - - uses: actions/go-hashfiles@v0.0.1 + - uses: https://gitea.com/actions/go-hashfiles@v0.0.1 id: hugo-deps-hash with: patterns: '**/go.sum' @@ -66,7 +66,7 @@ jobs: extended: true # Generate hash for Hugo resources - - uses: actions/go-hashfiles@v0.0.1 + - uses: https://gitea.com/actions/go-hashfiles@v0.0.1 id: hugo-resources-hash with: patterns: |- @@ -89,7 +89,7 @@ jobs: run: hugo --minify --buildFuture # Generate hash for apt cache - - uses: actions/go-hashfiles@v0.0.1 + - uses: https://gitea.com/actions/go-hashfiles@v0.0.1 id: apt-hash with: patterns: '**/deploy.yml' From a9c8ca877b368eb4f070beff7968aead0d38a0e4 Mon Sep 17 00:00:00 2001 From: bennolor Date: Tue, 17 Jun 2025 23:46:08 +0200 Subject: [PATCH 3/4] revert e5884ee89780c64d8e925be4fd609d217287704e revert repointed link --- .gitea/workflows/deploy.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index ff75a86..a180e28 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -22,7 +22,7 @@ jobs: go-version: '1.20' # Generate hash for submodules - - uses: https://gitea.com/actions/go-hashfiles@v0.0.1 + - uses: actions/go-hashfiles@v0.0.1 id: submodules-hash with: patterns: .gitmodules @@ -45,7 +45,7 @@ jobs: run: git submodule update --init --recursive # Generate hash for Hugo dependencies - - uses: https://gitea.com/actions/go-hashfiles@v0.0.1 + - uses: actions/go-hashfiles@v0.0.1 id: hugo-deps-hash with: patterns: '**/go.sum' @@ -66,7 +66,7 @@ jobs: extended: true # Generate hash for Hugo resources - - uses: https://gitea.com/actions/go-hashfiles@v0.0.1 + - uses: actions/go-hashfiles@v0.0.1 id: hugo-resources-hash with: patterns: |- @@ -89,7 +89,7 @@ jobs: run: hugo --minify --buildFuture # Generate hash for apt cache - - uses: https://gitea.com/actions/go-hashfiles@v0.0.1 + - uses: actions/go-hashfiles@v0.0.1 id: apt-hash with: patterns: '**/deploy.yml' From 9bb267d464bc079b00e8be574614b8ad15132ff9 Mon Sep 17 00:00:00 2001 From: bennolor Date: Tue, 17 Jun 2025 23:46:38 +0200 Subject: [PATCH 4/4] revert 83639ac94d407d288c42e20d2b1c980d5750dd7a revert replaced hashing function for caching --- .gitea/workflows/deploy.yml | 42 ++++--------------------------------- 1 file changed, 4 insertions(+), 38 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index a180e28..47ec5e3 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -16,17 +16,6 @@ jobs: submodules: false # Don't fetch submodules yet fetch-depth: 0 - # Setup Go for the go-hashfiles action - - uses: actions/setup-go@v3 - with: - go-version: '1.20' - - # Generate hash for submodules - - uses: actions/go-hashfiles@v0.0.1 - id: submodules-hash - with: - patterns: .gitmodules - # Cache the submodule content - name: Cache submodules id: cache-submodules @@ -35,7 +24,7 @@ jobs: path: | .git/modules themes/blowfish - key: ${{ runner.os }}-submodules-${{ steps.submodules-hash.outputs.hash }} + key: ${{ runner.os }}-submodules-${{ hashFiles('.gitmodules') }} restore-keys: | ${{ runner.os }}-submodules- @@ -44,18 +33,12 @@ jobs: if: steps.cache-submodules.outputs.cache-hit != 'true' run: git submodule update --init --recursive - # Generate hash for Hugo dependencies - - uses: actions/go-hashfiles@v0.0.1 - id: hugo-deps-hash - with: - patterns: '**/go.sum' - # Cache Hugo dependencies and modules - name: Cache Hugo dependencies uses: actions/cache@v3 with: path: /tmp/hugo_cache - key: ${{ runner.os }}-hugo-${{ steps.hugo-deps-hash.outputs.hash }} + key: ${{ runner.os }}-hugo-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-hugo- @@ -65,41 +48,24 @@ jobs: hugo-version: "latest" extended: true - # Generate hash for Hugo resources - - uses: actions/go-hashfiles@v0.0.1 - id: hugo-resources-hash - with: - patterns: |- - content/** - layouts/** - static/** - themes/** - config/** - # Cache resources but not public to prevent infinite loops - name: Cache Hugo resources uses: actions/cache@v3 with: path: resources/_gen - key: ${{ runner.os }}-hugo-resources-${{ steps.hugo-resources-hash.outputs.hash }} + key: ${{ runner.os }}-hugo-resources-${{ hashFiles('content/**', 'layouts/**', 'static/**', 'themes/**', 'config/**') }} restore-keys: | ${{ runner.os }}-hugo-resources- - name: Build run: hugo --minify --buildFuture - # Generate hash for apt cache - - uses: actions/go-hashfiles@v0.0.1 - id: apt-hash - with: - patterns: '**/deploy.yml' - # Cache apt packages - name: Cache apt packages uses: actions/cache@v3 with: path: /var/cache/apt/archives - key: ${{ runner.os }}-apt-${{ steps.apt-hash.outputs.hash }} + key: ${{ runner.os }}-apt-${{ hashFiles('**/deploy.yml') }} restore-keys: | ${{ runner.os }}-apt-