Files
hell-world/.woodpecker.yaml
Erdenebat Tsenddorj 0357261289
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
fix: use Kaniko instead of privileged Docker
- Replace docker:dind with Kaniko for rootless builds
- Remove deprecated secrets syntax
- Combine build and push steps

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 21:20:53 +08:00

69 lines
2.3 KiB
YAML

# Woodpecker CI Pipeline
# Go Backend + Next.js Frontend + PostgreSQL
when:
- event: [push, pull_request]
branch: main
steps:
# 1. Backend Docker image build & push
build-backend:
image: gcr.io/kaniko-project/executor:latest
commands:
- >
/kaniko/executor
--context=/woodpecker/src
--dockerfile=backend/Dockerfile
--destination=registry.gecore.mn/library/hell-world-backend:${CI_COMMIT_SHA:0:8}
--destination=registry.gecore.mn/library/hell-world-backend:latest
--cache=true
environment:
DOCKER_CONFIG: /kaniko/.docker
when:
event: push
branch: main
# 2. Frontend Docker image build & push
build-frontend:
image: gcr.io/kaniko-project/executor:latest
commands:
- >
/kaniko/executor
--context=/woodpecker/src
--dockerfile=frontend/Dockerfile
--destination=registry.gecore.mn/library/hell-world-frontend:${CI_COMMIT_SHA:0:8}
--destination=registry.gecore.mn/library/hell-world-frontend:latest
--cache=true
environment:
DOCKER_CONFIG: /kaniko/.docker
when:
event: push
branch: main
# 3. Update Kubernetes manifests with new image tags
update-manifests:
image: alpine:latest
commands:
- apk add --no-cache sed git
- 'sed -i "s#image:.*hell-world-backend.*#image: registry.gecore.mn/library/hell-world-backend:${CI_COMMIT_SHA:0:8}#g" manifests/backend-deployment.yaml'
- 'sed -i "s#image:.*hell-world-frontend.*#image: registry.gecore.mn/library/hell-world-frontend:${CI_COMMIT_SHA:0:8}#g" manifests/frontend-deployment.yaml'
- git config user.email "ci@gecore.mn"
- git config user.name "Woodpecker CI"
- git add manifests/
- 'git commit -m "ci: update images to ${CI_COMMIT_SHA:0:8}" || true'
- git push origin main || true
when:
event: push
branch: main
# 4. Deploy notification
notify:
image: alpine:latest
commands:
- 'echo "Build completed for commit ${CI_COMMIT_SHA:0:8}"'
- 'echo "Backend - registry.gecore.mn/library/hell-world-backend:${CI_COMMIT_SHA:0:8}"'
- 'echo "Frontend - registry.gecore.mn/library/hell-world-frontend:${CI_COMMIT_SHA:0:8}"'
- 'echo "ArgoCD will sync automatically"'
when:
status: [success, failure]