From b072a6053644e2a6288e664b6ea6dfb42cafd446 Mon Sep 17 00:00:00 2001 From: Mikhail Kilin Date: Thu, 19 Feb 2026 12:00:55 +0300 Subject: [PATCH] Add Woodpecker CI pipeline, make Dockerfile multi-stage - Multi-stage Dockerfile: download Zig 0.15.2, build inside Docker - .woodpecker/deploy.yml: Kaniko build + push + manifest update Co-Authored-By: Claude Opus 4.6 --- .woodpecker/deploy.yml | 33 +++++++++++++++++++++++++++++++++ Dockerfile | 10 +++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 .woodpecker/deploy.yml diff --git a/.woodpecker/deploy.yml b/.woodpecker/deploy.yml new file mode 100644 index 0000000..debe729 --- /dev/null +++ b/.woodpecker/deploy.yml @@ -0,0 +1,33 @@ +when: + - branch: main + event: push + path: + exclude: + - 'k8s/**' + on_empty: true + +steps: + - name: build-and-push + image: woodpeckerci/plugin-kaniko + settings: + registry: git.mikhailkilin.ru + repo: killingdruid/transcribator + tags: ${CI_COMMIT_SHA} + username: + from_secret: docker_username + password: + from_secret: docker_password + + - name: update-manifests + image: alpine/git + environment: + GIT_TOKEN: + from_secret: git_push_token + commands: + - 'printf "machine git.mikhailkilin.ru\nlogin killingdruid\npassword %s\n" "$GIT_TOKEN" > ~/.netrc' + - 'chmod 600 ~/.netrc' + - 'sed -i "s#image: git.mikhailkilin.ru/killingdruid/transcribator:.*#image: git.mikhailkilin.ru/killingdruid/transcribator:${CI_COMMIT_SHA}#" k8s/transcribator.yaml' + - 'git config user.email "woodpecker@ci"' + - 'git config user.name "Woodpecker CI"' + - 'git add k8s/transcribator.yaml' + - 'git diff --cached --quiet && echo "No changes" || (git commit -m "[CI SKIP] deploy ${CI_COMMIT_SHA}" && git push origin HEAD:main)' diff --git a/Dockerfile b/Dockerfile index cf1b35c..2af4d59 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,12 @@ +FROM alpine:3.21 AS builder +RUN apk add --no-cache curl xz +WORKDIR /zig +RUN curl -fsSL https://ziglang.org/download/0.15.2/zig-x86_64-linux-0.15.2.tar.xz | tar xJ --strip-components=1 +WORKDIR /app +COPY . . +RUN /zig/zig build -Doptimize=ReleaseSafe + FROM alpine:3.21 RUN apk add --no-cache ffmpeg curl ca-certificates -COPY zig-out/bin/transcribator /usr/local/bin/ +COPY --from=builder /app/zig-out/bin/transcribator /usr/local/bin/ CMD ["transcribator"]