Add PR checks pipeline (fmt, clippy, test) and split CI config
- Split .woodpecker.yml into .woodpecker/check.yml (PR checks) and .woodpecker/deploy.yml (deploy on push to main) - Add basic handler test to src/main.rs 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/bcard
|
||||
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/bcard:.*#image: git.mikhailkilin.ru/killingdruid/bcard:${CI_COMMIT_SHA}#" k8s/bcard.yaml'
|
||||
- 'git config user.email "woodpecker@ci"'
|
||||
- 'git config user.name "Woodpecker CI"'
|
||||
- 'git add k8s/bcard.yaml'
|
||||
- 'git diff --cached --quiet && echo "No changes" || (git commit -m "[CI SKIP] deploy ${CI_COMMIT_SHA}" && git push origin HEAD:main)'
|
||||
Reference in New Issue
Block a user