diff --git a/.drone.yml b/.drone.yml index 0656138..ddb4722 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,12 +3,34 @@ type: docker name: default steps: + - name: restore cache + image: drillster/drone-cache + settings: + restore: true + mount: + - go/pkg/mod + - ~/.cache/go-build + backend: local + cache_key: go-mod-cache-{{ checksum "go.sum" }} + - name: build image: golang:1.22 commands: + - go env -w GO111MODULE=on + - go env -w GOPROXY=https://goproxy.cn,direct - go mod tidy - go build -o main.exe . + - name: rebuild cache + image: drillster/drone-cache + settings: + rebuild: true + mount: + - go/pkg/mod + - ~/.cache/go-build + backend: local + cache_key: go-mod-cache-{{ checksum "go.sum" }} + - name: upload image: appleboy/scp settings: