Merge pull request 'add build caching' (#12) from build-caching into master
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Reviewed-on: #12
This commit was merged in pull request #12.
This commit is contained in:
@@ -1,5 +1,25 @@
|
|||||||
steps:
|
steps:
|
||||||
|
test:
|
||||||
|
image: golang:1.26
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: 0
|
||||||
|
GOOS: linux
|
||||||
|
commands:
|
||||||
|
- go test ./...
|
||||||
|
volumes:
|
||||||
|
- go_build_cache:/root/.cache/go-build
|
||||||
|
- go_mod_cache:/go/pkg/mod
|
||||||
build:
|
build:
|
||||||
|
image: golang:1.26
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: 0
|
||||||
|
GOOS: linux
|
||||||
|
commands:
|
||||||
|
- go build .
|
||||||
|
volumes:
|
||||||
|
- go_build_cache:/root/.cache/go-build
|
||||||
|
- go_mod_cache:/go/pkg/mod
|
||||||
|
deploy:
|
||||||
image: docker
|
image: docker
|
||||||
commands:
|
commands:
|
||||||
- apk add curl
|
- apk add curl
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
FROM golang:1.26 as builder
|
|
||||||
COPY . /castor
|
|
||||||
RUN cd /castor && CGO_ENABLED=0 go build
|
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
COPY --from=builder /castor/castor castor
|
COPY ./castor castor
|
||||||
CMD ["/castor"]
|
CMD ["/castor"]
|
||||||
Reference in New Issue
Block a user