ca-grow-ops-manager/.agent/workflows/deploy.md
fullsizemalt f8a368be62
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
Test / backend-test (push) Failing after 0s
Test / frontend-test (push) Failing after 0s
feat: Layout Designer enhancements (#1)
- Added ability to create new Floors and properties directly in Layout Designer
- Implemented AddFloorModal
- Updated FloorSelector to support adding properties/floors
- Fixed missing capabilities in PropertySetup
- Resolved circular dependencies and duplicate imports
2025-12-11 11:31:07 -08:00

124 lines
2.5 KiB
Markdown

---
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 <https://git.runfoo.run>
- 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**: <https://777wolfpack.runfoo.run>
- **API Health**: <https://777wolfpack.runfoo.run/api/healthz>
- **Forgejo**: <https://git.runfoo.run/malty/ca-grow-ops-manager>
- **Forgejo SSH**: ssh://git@localhost:2222/malty/ca-grow-ops-manager.git (from nexus-vector)