Persisting go modules cache between pipelines and stages

Hey guys, I wanted to know if someone had similar experience. We have Drone CI configured running in our K8s cluster using Github.

Basically rn our pipelines run hell amount of a time, and it’s mainly because of go downloading module dependencies on each pipeline run. What I want to have is persistence of go modules folder between pipeline or stages, so on next runs it won’t have to download all of that. As an example you can include this command in Dockerfile and cache will be persisted on next builds:

RUN --mount=type=cache,target=/go/pkg/mod

I’m aware of Persistent Storage in Drone, but not sure how to use it. Any suggestions ?