ci(drone): 添加 Go 模块和构建缓存

- 在 restore cache 和 rebuild cache 步骤中添加了 go-mod-cache 和 go-build-cache 卷
- 新增了主机路径缓存,提高 CI
This commit is contained in:
hxt
2025-07-08 20:54:24 +08:00
parent 06e5c364a8
commit 5de9db3cc8

View File

@@ -5,6 +5,11 @@ name: default
steps:
- name: restore cache
image: drillster/drone-volume-cache
volumes:
- name: go-mod-cache
path: /go/pkg/mod
- name: go-build-cache
path: /root/.cache/go-build
settings:
restore: true
mount:
@@ -23,6 +28,11 @@ steps:
- name: rebuild cache
image: drillster/drone-volume-cache
volumes:
- name: go-mod-cache
path: /go/pkg/mod
- name: go-build-cache
path: /root/.cache/go-build
settings:
rebuild: true
mount:
@@ -56,4 +66,11 @@ steps:
# script:
# - cd /your/deploy/path/
# - chmod +x start.sh
# - ./start.sh
# - ./start.sh
volumes:
- name: go-mod-cache
host:
path: /opt/drone/cache/go-mod
- name: go-build-cache
host:
path: /opt/drone/cache/go-build