feat: pipeline container build
Some checks failed
Sample Testing / my_job (push) Failing after 1m27s
CI / lint (push) Failing after 2m51s
CI / release (push) Failing after 4m2s

This commit is contained in:
Marcel S. Henselin 2026-04-17 16:03:31 +02:00
parent cceaea7cb7
commit 0414cf6dfb
6 changed files with 115 additions and 37 deletions

View file

@ -1,10 +1,29 @@
FROM golang:1.26
FROM golang:1.26 AS builder
WORKDIR /src
RUN apt-get update && apt-get -y install upx
WORKDIR /app
ENV CGO_ENABLED=0
COPY . .
RUN go get -u github.com/sethvargo/go-githubactions/... \
&& go mod tidy \
&& go build -o /bin/google-chat-action
RUN go mod tidy && go build \
-a \
-trimpath \
-ldflags "-s -w -extldflags '-static'" \
-installsuffix cgo \
-tags netgo \
-o /bin/google-chat-action \
.
RUN strip /bin/google-chat-action
RUN upx -q -9 /bin/google-chat-action
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /bin/google-chat-action /bin/google-chat-action
ENTRYPOINT ["/bin/google-chat-action"]