feat(ci): skip build if no source changes (cache build output by hash)
This commit is contained in:
@@ -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 .
|
||||
|
||||
|
||||
Reference in New Issue
Block a user