feat(ci): skip build if no source changes (cache build output by hash)

This commit is contained in:
datadunia
2026-06-18 09:09:51 +07:00
parent 6f22aad1ad
commit 08b152a370
3 changed files with 45 additions and 2 deletions
+15
View File
@@ -24,7 +24,22 @@ jobs:
go-version: '1.26'
cache: true
- uses: https://gitea.com/actions/go-hashfiles@v0.0.1
id: hash-src
with:
patterns: |
apps/server-core/**/*.go
apps/server-core/go.mod
apps/server-core/go.sum
- uses: actions/cache@v3
id: cache-build
with:
path: apps/server-core/bin
key: build-server-core-${{ steps.hash-src.outputs.hash }}
- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
working-directory: apps/server-core
run: go build -o bin/server-core .