Skip to content
Clone

feat(ci): ship the actions engine binary in the main image

The CI service spawns gitdata-actions-engine for parse/trigger/evaluate/expand/cron/OIDC
(lib/ci/src/actions.rs:145), not only the runner, so every server role needs it on PATH.
ZhenYi committed
parent 159a1eb commit ea6d080 Browse files

1 file changed

+21 −0

Modified Dockerfile View Dockerfile
@@ -45,6 +45,22 @@
4545 && cp /tmp/docker/docker /out/docker \
4646 && rm -rf /tmp/docker /tmp/docker.tgz
4747
48########## actions engine ##########
49# The server side of CI (workflow parse/trigger/evaluate/expand, cron matching,
50# OIDC) shells out to `gitdata-actions-engine` on every operation, not just the
51# runner; ship it in this image too.
52FROM golang:1.27-bookworm AS actions-engine
53
54WORKDIR /src
55COPY act/go.mod act/go.sum ./
56COPY act/cmd ./cmd
57COPY act/pkg ./pkg
58
59RUN --mount=type=cache,target=/go/pkg/mod \
60 --mount=type=cache,target=/root/.cache/go-build \
61 CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" \
62 -o /out/gitdata-actions-engine ./cmd/gitdata-actions-engine
63
4864########## runtime ##########
4965FROM debian:bookworm-slim
5066
@@ -66,6 +82,11 @@
6682
6783COPY --from=builder /out/docker /usr/local/bin/docker
6884
85# `gitdata-actions-engine` is spawned by the CI service (lib/ci/src/actions.rs:145)
86# as well as by the runner, so the default APP_CI__ACTIONS_ENGINE_BINARY value
87# (a bare name resolved via PATH) works in every role.
88COPY --from=actions-engine /out/gitdata-actions-engine /usr/local/bin/gitdata-actions-engine
89
6990USER gitdata
7091
7192EXPOSE 3000 9418 22 3001 3002 3003 3004 3005 3006