Каркас monorepo: scheduler, data_collector, khbuild_assistant_prep, khb_common; миграции; CI/CD
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
37
.gitea/workflows/ci.yaml
Normal file
37
.gitea/workflows/ci.yaml
Normal file
@@ -0,0 +1,37 @@
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: install
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: build + typecheck
|
||||
run: pnpm -r build
|
||||
- name: test (unit + integration на временной БД llmtest_*)
|
||||
env:
|
||||
KHB_APP_DB_PASSWORD: ${{ secrets.KHB_APP_DB_PASSWORD }}
|
||||
run: |
|
||||
DB_IP=$(sudo -n docker inspect -f '{{.NetworkSettings.Networks.supabase_default.IPAddress}}' supabase-db)
|
||||
export KHB_TEST_DATABASE_URL="postgres://khb_app:${KHB_APP_DB_PASSWORD}@${DB_IP}:5432/postgres"
|
||||
pnpm test
|
||||
|
||||
deploy:
|
||||
needs: test
|
||||
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: build image
|
||||
run: |
|
||||
TAG=$(git rev-parse --short=12 HEAD)
|
||||
echo "$TAG" > .image_tag
|
||||
sudo -n docker build -t "khb-microservices:${TAG}" .
|
||||
- name: deploy
|
||||
run: sudo -n /y/services/khb-deploy/deploy.sh "$(cat .image_tag)"
|
||||
Reference in New Issue
Block a user