ci: 添加Go模块缓存和Docker构建缓存
This commit is contained in:
@@ -10,6 +10,9 @@ on:
|
||||
- master
|
||||
- dev
|
||||
|
||||
env:
|
||||
GO_VERSION: '1.25'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -20,8 +23,15 @@ jobs:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.25'
|
||||
cache: false
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache: true
|
||||
|
||||
- name: Go cache info
|
||||
run: |
|
||||
echo "Go cache directory:"
|
||||
go env GOCACHE
|
||||
echo "Go module cache directory:"
|
||||
go env GOMODCACHE
|
||||
|
||||
- name: Install build tools
|
||||
run: sudo apt-get update && sudo apt-get install -y gcc
|
||||
@@ -76,3 +86,5 @@ jobs:
|
||||
code.littlelan.cn/carrot_bbs/backend:latest
|
||||
code.littlelan.cn/carrot_bbs/backend:${{ github.sha }}
|
||||
platforms: linux/amd64
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
Reference in New Issue
Block a user