cohorta/.gitea/workflows/deploy.yml
Vadym Samoilenko 0f11c2d201
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
CI/CD: use host-mode runner — direct deploy without SSH action
Runner runs directly on aimpress server (ubuntu-latest:host).
No need for appleboy/ssh-action Docker container.
Each step runs shell commands directly on the deploy server.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-23 18:54:57 +01:00

41 lines
1.2 KiB
YAML

name: Deploy to Production
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Pull latest code
run: |
set -euo pipefail
echo "=== Pulling latest code ==="
git -C /opt/03-business/cohorta pull --ff-only
git -C /opt/03-business/cohorta log --oneline -3
- name: Ensure traefik-public network
run: |
docker network ls --format '{{.Name}}' | grep -q '^traefik-public$' \
|| docker network create traefik-public
- name: Build and restart containers
run: |
set -euo pipefail
cd /opt/03-business/cohorta
docker compose build --no-cache frontend backend
docker compose up -d --remove-orphans
- name: Health check
run: |
echo "Waiting for backend..."
for i in $(seq 1 30); do
curl -sf http://localhost:5137/api/health > /dev/null 2>&1 && echo "✓ Backend healthy" && break
sleep 3
done
docker compose -f /opt/03-business/cohorta/docker-compose.yml ps
- name: Done
run: echo "=== Deploy complete === https://cohorta.ai-impress.com"