Add Woodpecker CI pipeline, make Dockerfile multi-stage
Some checks failed
ci/woodpecker/push/deploy Pipeline failed
Some checks failed
ci/woodpecker/push/deploy Pipeline failed
- 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 <noreply@anthropic.com>
This commit is contained in:
33
.woodpecker/deploy.yml
Normal file
33
.woodpecker/deploy.yml
Normal file
@@ -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)'
|
||||
10
Dockerfile
10
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"]
|
||||
|
||||
Reference in New Issue
Block a user