--- description: Deploy ca-grow-ops-manager to nexus-vector via Forgejo --- # Deploying CA Grow Ops Manager ## Prerequisites - SSH access to nexus-vector (via Tailscale) - Forgejo accessible at - Deploy key authorized for the repository ## Standard Deployment (CI/CD Automatic) Pushing to `main` branch triggers automatic deployment via Forgejo Actions: ```bash # From local machine cd /Users/ten/ANTIGRAVITY/777wolfpack/ca-grow-ops-manager git add -A git commit -m "your commit message" git push origin main ``` The CI/CD workflow will: 1. Pull latest code on nexus-vector 2. Rebuild containers 3. Run database migrations 4. Seed demo data (if needed) 5. Restart services ## Manual Deployment (When CI/CD Fails) // turbo-all ### 1. SSH into nexus-vector ```bash ssh nexus-vector ``` ### 2. Navigate to project ```bash cd /srv/containers/ca-grow-ops-manager ``` ### 3. Pull latest code (use admin user for Forgejo access) ```bash # If deploy key is set up: sudo -u admin git pull origin main # If that fails, use HTTPS with token: git pull https://git.runfoo.run/malty/ca-grow-ops-manager.git main ``` ### 4. Rebuild and deploy ```bash docker compose build --no-cache docker compose up -d db redis sleep 5 docker compose run --rm backend npx prisma migrate deploy docker compose run --rm backend node prisma/seed.js docker compose up -d ``` ### 5. Verify deployment ```bash docker compose ps curl -s http://localhost:8010/api/healthz ``` ## Troubleshooting ### Forgejo 502 Error Forgejo container may need restart: ```bash cd /srv/containers/forgejo docker compose restart forgejo ``` ### Git Permission Denied Deploy key not authorized. Either: 1. Add deploy key to repo in Forgejo UI (Settings > Deploy Keys) 2. Use HTTPS with personal access token ### SSH Host Key Changed ```bash ssh-keygen -f ~/.ssh/known_hosts -R '[localhost]:2222' ssh-keyscan -p 2222 localhost >> ~/.ssh/known_hosts ``` ## Useful Commands ```bash # View logs docker compose logs -f frontend docker compose logs -f backend # Check container health docker compose ps # Run database commands docker compose exec db psql -U ca_grow_ops -d ca_grow_ops # Restart specific service docker compose restart backend ``` ## URLs - **Live Site**: - **API Health**: - **Forgejo**: - **Forgejo SSH**: ssh://git@localhost:2222/malty/ca-grow-ops-manager.git (from nexus-vector)