chore: add vendor target for bake

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
David Karlsson 2023-08-23 15:05:42 +02:00
parent 2d8290fa5e
commit 9543cd0db5
2 changed files with 19 additions and 0 deletions

View File

@ -39,3 +39,14 @@ WORKDIR /test
COPY --from=build /out ./public
ADD .htmltest.yml .htmltest.yml
RUN htmltest
FROM build-base as update-modules
ARG MODULE="-u"
WORKDIR /src
COPY . .
RUN hugo mod get ${MODULE}
RUN hugo mod vendor
FROM scratch as vendor
COPY --from=update-modules /src/_vendor /_vendor
COPY --from=update-modules /src/go.* /

View File

@ -140,3 +140,11 @@ target "aws-cloudfront-update" {
no-cache-filter = ["aws-cloudfront-update"]
output = ["type=cacheonly"]
}
target "vendor" {
target = "vendor"
args = {
MODULE = null
}
output = ["."]
}