Skip to content

Commit a391c8e

Browse files
committed
Update docs/content/manuals/build/ci/github-actions/cache.md
Signed-off-by: Eng Zer Jun <[email protected]>
1 parent 5ed1d65 commit a391c8e

File tree

1 file changed

+5
-3
lines changed
  • content/manuals/build/ci/github-actions

1 file changed

+5
-3
lines changed

content/manuals/build/ci/github-actions/cache.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,14 @@ FROM golang:1.21.1-alpine as base-build
198198
199199
WORKDIR /build
200200
201-
COPY go.mod go.sum ./
202-
RUN --mount=type=cache,target=/root/.cache/go-build go mod download
201+
RUN --mount=type=cache,target=/go/pkg/mod \
202+
--mount=type=bind,source=go.mod,target=go.mod \
203+
--mount=type=bind,source=go.sum,target=go.sum \
204+
go mod download
203205
204206
RUN --mount=type=cache,target=/go/pkg/mod \
205207
--mount=type=cache,target=/root/.cache/go-build \
206-
--mount=type=bind,source=src,target=./src \
208+
--mount=type=bind,target=. \
207209
go build -o /bin/app ./src
208210
...
209211
```

0 commit comments

Comments
 (0)