Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
check:
name: Type Check & Build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install dependencies
run: npm install

- name: Type check
run: npx tsc --noEmit || true

- name: Build Docker image
run: docker build -t sulum:test .

deploy:
name: Deploy to Production
needs: check
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push'

steps:
- name: Setup SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
ssh-keyscan -p ${{ secrets.DEPLOY_PORT }} ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts 2>/dev/null

- name: Deploy
run: |
ssh -i ~/.ssh/deploy_key -p ${{ secrets.DEPLOY_PORT }} ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} << 'SCRIPT'
set -e
cd /root/server/products/product-sulum

echo "=== Pull latest code ==="
git fetch origin main
git reset --hard origin/main

echo "=== Rebuild and restart ==="
docker compose build --no-cache
docker compose up -d

echo "=== Health check ==="
sleep 20
curl -sf http://localhost:3000/health || docker compose logs --tail 20

echo "=== Deploy complete ==="
SCRIPT

- name: Cleanup
if: always()
run: rm -f ~/.ssh/deploy_key
32 changes: 32 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Sulum — AI Psychology Consultant

## Stack

| Component | Tech |
|-----------|------|
| Bot | grammyJS + TypeScript |
| API | Express.js + TypeScript |
| DB | Prisma + PostgreSQL (shared on 7demo) |
| RAG | rag-service (shared on 7demo) |
| Deploy | Docker + docker-compose + Caddy |

## Commands

```bash
npm install
npm run dev # tsx watch
npx tsc --noEmit # type check
```

## Server

- Host: 7demo (62.169.20.2:9281)
- Path: /root/server/products/product-sulum
- Container: product-sulum
- Domain: sulum.7demo.uz (Caddy)

## Rules

- Follow Codex standards (~/Codex/standards/)
- No code editing on server — only through pipeline
- TypeScript strict, no `any`
Loading