Files
khb_microservices/.gitea/workflows/ci.yaml
Yuri Yaryshev ebb1cb7950
Some checks failed
ci / test (push) Failing after 20s
ci / deploy (push) Has been skipped
Каркас monorepo: scheduler, data_collector, khbuild_assistant_prep, khb_common; миграции; CI/CD
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 09:44:55 +03:00

38 lines
1.1 KiB
YAML

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)"