Deploy a New Version Overview
This section focuses on the standard, day-to-day deployment process for applications. It provides step-by-step guides for deploying different components of the SBM CRM Platform to staging and production environments.
Overview
The SBM CRM Platform consists of multiple components that require different deployment processes:
- WeChat Mini Program - Deployed through WeChat Developer Tools and the WeChat Official Account Platform
- Admin Panel - Web-based administration interface deployed via GitHub Actions
- API Services - Backend services deployed via GitHub Actions with nginx routing configuration
Each component follows a similar workflow but has specific requirements and steps that must be followed.
Deployment Workflow
The general deployment workflow follows these stages:
1. Development
- Work on feature branches (
feat/xxx) - Test changes locally
- Create Pull Requests for code review
2. Staging Deployment
- Merge to
developbranch - Deploy to staging environment via GitHub Actions (for Admin Panel and API)
- Test functionality in staging
- Validate changes before production
3. Production Deployment
- Create release or hotfix branch from
develop - Follow semantic versioning (SemVer)
- Merge to
mainbranch after approval - Deploy to production environment
- Monitor and verify deployment
Follow semantic versioning (SemVer):
- Major (x): Breaking changes
- Minor (y): New features, backward compatible
- Patch (z): Bug fixes, backward compatible
Deployment Guides
WeChat Mini Program
Deploy the WeChat Mini Program to the WeChat Official Account Platform.
- WeChat Deployment Guide - Complete guide for building, uploading, and publishing WeChat Mini Programs
Admin Panel
Deploy the web-based Admin Panel to staging and production environments.
- Admin Panel Deployment Guide - Step-by-step instructions for deploying the Admin Panel via GitHub Actions
API Services
Deploy backend API services with nginx routing configuration.
- API Deployment Guide - Complete guide for deploying API services, including new module/service setup
Prerequisites
Before starting any deployment, ensure you have:
- Access to the repository and GitHub Actions
- Appropriate permissions for the target environment
- Understanding of the service versioning scheme
- Required credentials and environment variables configured
- SSH access (for API service configuration)
Best Practices
- Always Test in Staging First - Deploy to staging and thoroughly test before production
- Follow Branching Strategy - Use
developfor staging,mainfor production - Document Changes - Keep detailed notes about each deployment version
- Monitor Deployments - Watch deployment logs and verify services after deployment
- Use Semantic Versioning - Follow SemVer for consistent version numbering
- Sync Hotfixes - Always sync hotfix branches back to
developafter merging tomain - Verify After Deployment - Test key functionality after each deployment
Common Deployment Scenarios
Regular Feature Release
- Merge feature branch to
develop - Deploy to staging
- Test and validate
- Create
release/x.y.zbranch - Merge to
mainand deploy to production
Hotfix Release
- Create
hotfix/x.y.zbranch fromdevelop - Apply fix and test
- Merge to
mainand deploy to production - Important: Sync changes back to
developvia PR
New Service/Module
- Follow standard deployment process
- Configure nginx routing (for API services)
- Verify routing and connectivity
- Test all endpoints
Troubleshooting
If you encounter issues during deployment:
- Check Workflow Logs - Review GitHub Actions logs for specific errors
- Verify Service Status - Ensure containers are running and healthy
- Check Configuration - Verify environment variables and configuration files
- Review Documentation - Check the specific deployment guide for component-specific troubleshooting
- Contact DevOps Team - Reach out for assistance with infrastructure issues
Related Documentation
- Deployment Overview - General deployment and infrastructure documentation
- CI/CD Guide - GitHub Actions and CI/CD setup
- Configuration Guide - Environment configuration reference
- Environment Guide - Environment-specific configurations