ci: build CLI artifacts with Docker
Build and Deploy / deploy (push) Successful in 10m13s

This commit is contained in:
loveuer
2026-09-21 03:02:08 -07:00
parent 557ace6150
commit f1411aaeae
3 changed files with 37 additions and 4 deletions
+19
View File
@@ -18,6 +18,25 @@ COPY *.go ./
COPY --from=frontend /src/frontend/dist ./frontend/dist
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /ufile .
FROM golang:1.24-alpine AS cli-builder
ARG GOPROXY=https://proxy.golang.org,direct
ARG VERSION=dev
ARG COMMIT=unknown
ENV GOPROXY=${GOPROXY}
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY cmd/ufile-cli/ ./cmd/ufile-cli/
COPY scripts/build-cli.sh ./scripts/build-cli.sh
RUN VERSION="${VERSION}" COMMIT="${COMMIT}" ./scripts/build-cli.sh
FROM alpine:3.22 AS cli-artifacts
COPY --from=cli-builder /src/dist /dist
CMD ["sh", "-c", "while :; do sleep 3600; done"]
FROM alpine:3.22
RUN addgroup -S -g 10001 ufile \