Skip to main content

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 develop branch
  • 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 main branch after approval
  • Deploy to production environment
  • Monitor and verify deployment
Version Numbering

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.

Admin Panel

Deploy the web-based Admin Panel to staging and production environments.

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

  1. Always Test in Staging First - Deploy to staging and thoroughly test before production
  2. Follow Branching Strategy - Use develop for staging, main for production
  3. Document Changes - Keep detailed notes about each deployment version
  4. Monitor Deployments - Watch deployment logs and verify services after deployment
  5. Use Semantic Versioning - Follow SemVer for consistent version numbering
  6. Sync Hotfixes - Always sync hotfix branches back to develop after merging to main
  7. Verify After Deployment - Test key functionality after each deployment

Common Deployment Scenarios

Regular Feature Release

  1. Merge feature branch to develop
  2. Deploy to staging
  3. Test and validate
  4. Create release/x.y.z branch
  5. Merge to main and deploy to production

Hotfix Release

  1. Create hotfix/x.y.z branch from develop
  2. Apply fix and test
  3. Merge to main and deploy to production
  4. Important: Sync changes back to develop via PR

New Service/Module

  1. Follow standard deployment process
  2. Configure nginx routing (for API services)
  3. Verify routing and connectivity
  4. Test all endpoints

Troubleshooting

If you encounter issues during deployment:

  1. Check Workflow Logs - Review GitHub Actions logs for specific errors
  2. Verify Service Status - Ensure containers are running and healthy
  3. Check Configuration - Verify environment variables and configuration files
  4. Review Documentation - Check the specific deployment guide for component-specific troubleshooting
  5. Contact DevOps Team - Reach out for assistance with infrastructure issues