--- description: After every code change, push to git, build, and deploy to staging server alwaysApply: true --- # Deployment Workflow **When to apply:** After making any code changes to the project. **Important:** In this project, "production" refers to the **staging server**. The real production environment is separate. ## Required Steps After Each Change 1. **Update the code** – Complete your intended changes. 2. **Push to git** – Commit and push to the configured remote (e.g. `git.atmata-group.com/ATMATA/zerp`). 3. **Build** – Ensure both frontend and backend build successfully: - `cd frontend && npm run build` - `cd backend && npm run build` 4. **Deploy to staging** – Sync code to the staging server and rebuild containers: - Rsync project to `root@37.60.249.71:/root/z_crm/` (exclude `node_modules`, `.git`, `.next`) - SSH into server: `docker-compose down`, `docker-compose build --no-cache frontend backend`, `docker-compose up -d` - See `CONTACTS_DEPLOYMENT_GUIDE.md` for exact commands and credentials. **Staging URL:** https://zerp.atmata-group.com/ If deployment fails due to credentials or network, document the error and inform the user. Do not skip the deployment step unless explicitly asked.