| name | deployment-workflow |
| description | Use this before committing code or when preparing for deployment. Provides pre-deployment checks, version bumping strategy, releases.json update pattern, common build failures, and deployment best practices. |
Deployment Workflow for FOSSAPP
Essential pre-deployment checks and deployment procedures to ensure safe, reliable deployments to production.
⚠️ Pre-Deployment: MANDATORY Checks
1. Run Pre-Deployment Script (REQUIRED)
./scripts/deploy-check.sh
What it does:
- ✓ TypeScript type checking (
npm run type-check)
- ✓ ESLint validation (
npm run lint)
- ✓ Playwright smoke tests (7 critical path tests)
- ✓ Production build test (
npm run build)
⚠️ CRITICAL: Production builds are stricter than dev mode:
- ESLint runs with
--strict mode
- TypeScript type checking is enforced
- All warnings become errors
- Missing dependencies are caught
If ANY check fails: STOP and fix errors before proceeding.
2. Common Build Errors to Fix
const { theme, resolvedTheme } = useTheme()
const { resolvedTheme } = useTheme()
supplier_logo_dark: data.supplier_logo_dark
interface ProductDetail {
supplier_logo_dark?: string
}
useEffect(() => {
loadProducts()
}, [supplierFilter])
useEffect(() => {
loadProducts()
}, [supplierFilter])
Version Bumping Strategy
Semantic Versioning (MAJOR.MINOR.PATCH)
| Type | When to Use | Example |
|---|
| patch | Bug fixes, small changes | 1.1.3 → 1.1.4 |
| minor | New features, backwards compatible | 1.1.4 → 1.2.0 |
| major | Breaking changes | 1.2.0 → 2.0.0 |
Version Bump Commands
npm version patch
npm version minor
npm version major
⚠️ CRITICAL: Tag After Build Succeeds
NEVER tag until build succeeds!
npm version patch
git push origin main --tags
./scripts/deploy-check.sh
git add -A
git commit -m "..."
git push origin main
npm version patch
git push origin main --tags
Updating What's New Dialog (releases.json)
When to Update
Update when:
- ✅ New features added
- ✅ Significant UX changes
- ✅ User-visible improvements
Skip when:
- ❌ Bug fixes only
- ❌ Internal refactoring
- ❌ Dependency updates
Format
Add new release to TOP of src/data/releases.json:
{
"releases": [
{
"version": "X.Y.Z",
"date": "YYYY-MM-DD",
"title": "Short Title (3-5 words)",
"description": "One sentence summary.",
"features": [
"Feature 1",
"Feature 2",
"Feature 3"
],
"tagline": "Memorable closing phrase."
},
]
}
Example:
{
"version": "1.9.0",
"date": "2025-12-15",
"title": "Advanced Search Filters",
"description": "Powerful new search system with dynamic filters and taxonomy navigation.",
"features": [
"Three-tier search: Guided Finder + Smart Text + Technical Filters",
"Context-aware filters prevent '0 results' dead ends",
"Sub-200ms query performance on 56K+ products"
],
"tagline": "Finding the perfect lighting product just got easier."
}
Complete Deployment Workflow
Step 1: Development & Testing
npm run dev
./scripts/deploy-check.sh
Step 2: Update What's New (if applicable)
Step 3: Commit & Push
git add -A
git commit -m "feat: description of changes
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>"
git push origin main
Step 4: Version Bump
npm version patch
git push origin main --tags
Step 5: Deploy to Production
Recommended: Use production-deployer agent in Claude Code.
Manual:
ssh -i ~/.ssh/platon.key sysadmin@platon.titancnc.eu \
"cd /opt/fossapp && ./deploy.sh v1.9.0"
curl https://main.fossapp.online/api/health
Common Deployment Failures & Fixes
Issue 1: "Module not found" Error
Symptom:
Module not found: Can't resolve '@radix-ui/react-icons'
Cause: Missing dependency when adding shadcn components
Fix:
npm install @radix-ui/react-icons
git add package.json package-lock.json
git commit -m "fix: add missing dependency"
git push origin main
Issue 2: ESLint Errors in Production
Symptom:
Error: 'theme' is assigned a value but never used
Cause: Dev mode doesn't enforce ESLint strictly
Fix: Run ./scripts/deploy-check.sh locally, fix all errors
Issue 3: TypeScript Type Errors
Symptom:
Type error: Object literal may only specify known properties
Cause: Missing property in TypeScript interface
Fix: Update interface to match actual data structure
Issue 4: Docker Build Failures
Symptom: Build succeeds locally but fails in Docker
Cause:
- Different Node.js version (local vs Docker)
- Missing environment variables
- Cached layers with old dependencies
Fix:
ssh -i ~/.ssh/platon.key sysadmin@platon.titancnc.eu \
"cd /opt/fossapp && docker system prune -a --volumes"
./deploy.sh v1.9.0
Pre-Deployment Checklist
Before running npm version patch:
Before deploying to production:
After deployment:
Git Best Practices
Commit Message Convention
git commit -m "feat: Add product filtering"
git commit -m "fix: Resolve search bug"
git commit -m "docs: Update API documentation"
git commit -m "chore: Update dependencies"
Types:
feat: New features
fix: Bug fixes
docs: Documentation
chore: Maintenance
refactor: Code restructuring
style: Formatting
test: Tests
Environment Variables Sync
Sync Script
./scripts/sync-env.sh
./scripts/sync-env.sh --diff
./scripts/sync-env.sh --pull
When to Sync
- After changing API keys (APS, Google, Supabase)
- After adding new environment variables
- Before major deployments with config changes
Important: Always restart container after syncing:
docker compose restart fossapp
Production Server Details
Rollback Procedure
If deployment fails:
ssh -i ~/.ssh/platon.key sysadmin@platon.titancnc.eu
cd /opt/fossapp
git log -1
git checkout v1.8.0
docker-compose build
docker-compose up -d
curl https://main.fossapp.online/api/health
Quick Reference Commands
./scripts/deploy-check.sh
npm version patch
npm version minor
npm version major
git push origin main --tags
curl https://main.fossapp.online/api/health
ssh -i ~/.ssh/platon.key sysadmin@platon.titancnc.eu \
"cd /opt/fossapp && docker-compose logs -f"
Lessons Learned (v1.1.4 Deployment Issues)
What went wrong:
- ❌ Tagged version before testing production build
- ❌ Unused
theme variable not caught in dev
- ❌ Missing TypeScript interface properties
- ❌ Had to delete and recreate tag 3 times
What we learned:
- ✅ ALWAYS run
./scripts/deploy-check.sh before committing
- ✅ Never tag until build succeeds
- ✅ Production builds are stricter than dev
- ✅ Automated checks prevent deployment disasters
See Also