diff --git a/Dockerfile b/Dockerfile index 97f20fc..bd1dbff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,3 @@ -FROM golang:latest AS gojekyll - -ADD . /gojekyll - -WORKDIR /gojekyll - -RUN go build main.go - FROM bufbuild/buf AS buf FROM dart:stable AS sass @@ -17,6 +9,21 @@ RUN git clone https://github.com/sass/dart-sass.git /dart-sass && \ dart run grinder protobuf && \ dart compile exe bin/sass.dart + +FROM golangci/golangci-lint:latest AS golangci-lint +FROM golang:latest AS gojekyll + +ADD . /gojekyll + +COPY --from=golangci-lint /usr/bin/golangci-lint /usr/bin/golangci-lint +COPY --from=sass /dart-sass/bin/sass.exe /usr/bin/sass + +WORKDIR /gojekyll + +RUN golangci-lint run +RUN go test ./... +RUN go build main.go + FROM debian:stable-slim COPY --from=gojekyll /gojekyll/main /usr/bin/gojekyll