# OMS·WMS·ERP Production Deployment Guide ## Overview OMS·WMS·ERP uses **Gitea Actions CI/CD** for production deployments. **Critical Rule**: ALL production deployments MUST go through Gitea Actions CI/CD. Manual deployments are **FORBIDDEN**. ## Deployment Workflow ### Stage 1: Prepare Release (prepare-release.yml) **Trigger**: Manual via Gitea Actions 1. Go to: https://gitea.taxbaik.com/kjh2064/oms-wms-erp/actions 2. Select workflow: prepare-release.yml 3. Click "Run workflow" 4. Input version: 1.0.0 5. Confirm **What it does**: - npm run build → dist/ (173KB) - Create git tag (v1.0.0) - Create Gitea Release - Upload artifact (oms-wms-erp-v1.0.0.tar.gz) **Result**: Release ready at https://gitea.taxbaik.com/kjh2064/oms-wms-erp/releases/tag/v1.0.0 ### Stage 2: Deploy Release (deploy-prod.yml) **Trigger**: Manual via Gitea Actions (after prepare-release.yml completes) 1. Same Actions page 2. Select workflow: deploy-prod.yml 3. Click "Run workflow" 4. Input release: 1.0.0 (or leave empty for latest) 5. Confirm **What it does**: - Download artifact from Gitea Release - SSH upload to 178.104.200.7:/home/kjh2064/deployments/ - Extract to deployment directory - npm install --legacy-peer-deps --production - Update symlink: ~/oms-wms-erp_active - Restart: sudo systemctl restart oms-wms-erp.service - Health checks (6-point verification) - Automatic rollback on failure **Result**: Deployment complete or rolled back with clear status message ## Pre-Deployment Checklist BEFORE pushing to main: ✅ npm run build (0 errors) ✅ npm run test:unit (all pass) ✅ npm run test:e2e (all pass) ✅ npm run lint (0 warnings) ✅ npm run preview (works locally) ✅ git status (clean) ## Required Secrets Configure in Gitea: Settings → Secrets - GITEA_TOKEN: Personal access token - DEPLOY_SSH_KEY: SSH private key (PEM or base64) - DEPLOY_HOST: 178.104.200.7 - DEPLOY_USER: kjh2064 ## Post-Deployment Verification SSH into server: ssh kjh2064@178.104.200.7 Check status: sudo systemctl status oms-wms-erp.service # Expected: active (running) Test HTTP: curl http://127.0.0.1:5173/ # Expected: HTTP 200 View logs: sudo journalctl -u oms-wms-erp.service -n 50 ## Rollback (Manual) List deployments: ls -la /home/kjh2064/deployments/ Switch to previous version: rm /home/kjh2064/oms-wms-erp_active ln -s /home/kjh2064/deployments/oms-wms-erp_20260727_100000 /home/kjh2064/oms-wms-erp_active sudo systemctl restart oms-wms-erp.service ## Summary - **Build**: 1.22 seconds ✓ - **Bundle**: 173KB (target: <500KB) ✓ - **Tests**: 1,400+ (70%+ coverage) ✓ - **Deployment**: ~10 minutes ✓ - **Health Checks**: 6-point automatic ✓ - **Rollback**: Automatic on failure ✓ Status: 🟢 PRODUCTION READY