ci: 添加Go模块缓存和Docker构建缓存
Some checks failed
Build Backend / build (push) Successful in 12m35s
Build Backend / build-docker (push) Failing after 1m55s

This commit is contained in:
lafay
2026-03-21 14:15:27 +08:00
parent d7c7a51f77
commit fa68f101de

View File

@@ -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