Skip to content

Commit dc0d31f

Browse files
committed
chore(ci): cache go modules with unified key to reduce cache size
1 parent f423b65 commit dc0d31f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,23 @@ jobs:
157157
echo "DIST=nginx-ui-$_NAME" >> $GITHUB_ENV
158158
echo "ARTIFACT=$_ARTIFACT" >> $GITHUB_ENV
159159
160-
- name: Setup go caches
160+
- name: Setup Go modules cache
161161
uses: actions/cache@v4
162162
with:
163163
path: |
164164
~/go/pkg/mod
165+
key: go-${{ runner.os }}-${{ runner.arch }}-mod-${{ hashFiles('go.mod') }}
166+
restore-keys: |
167+
go-${{ runner.os }}-${{ runner.arch }}-mod-
168+
169+
- name: Setup Go build cache
170+
uses: actions/cache@v4
171+
with:
172+
path: |
165173
~/.cache/go-build
166174
key: go-${{ runner.os }}-${{ runner.arch }}-${{ env.CACHE_NAME }}-${{ hashFiles('go.mod') }}
175+
restore-keys: |
176+
go-${{ runner.os }}-${{ runner.arch }}-${{ env.CACHE_NAME }}-
167177
168178
- name: Download app artifacts
169179
uses: actions/download-artifact@v4

0 commit comments

Comments
 (0)