ci(drone): 添加 Go 模块和构建缓存
- 在 restore cache 和 rebuild cache 步骤中添加了 go-mod-cache 和 go-build-cache 卷 - 新增了主机路径缓存,提高 CI
This commit is contained in:
17
.drone.yml
17
.drone.yml
@@ -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:
|
||||
@@ -57,3 +67,10 @@ steps:
|
||||
# - cd /your/deploy/path/
|
||||
# - chmod +x 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
|
||||
Reference in New Issue
Block a user