add build caching #12

Merged
alazyreader merged 1 commits from build-caching into master 2026-02-15 02:04:16 +00:00
3 changed files with 22 additions and 6 deletions

View File

@@ -1,5 +1,25 @@
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:
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
commands:
- apk add curl

View File

@@ -1,7 +1,3 @@
FROM golang:1.26 as builder
COPY . /castor
RUN cd /castor && CGO_ENABLED=0 go build
FROM scratch
COPY --from=builder /castor/castor castor
COPY ./castor castor
CMD ["/castor"]

2
go.mod
View File

@@ -1,3 +1,3 @@
module git.yetaga.in/alazyreader/castor
go 1.25.1
go 1.26.0