Mule Application CI/CD Deployment Architecture
Overview
GitHub pipeline architecture for the MuleSoft application, detailing the automated build, test, and deployment workflows using GitHub Actions and Anypoint Platform.
Architecture Diagram

Deployment Architecture
Pipeline Components
1Source Control – GitHub Repository
Sample https://github.com/chandanrjit/server-info-ch04-20231128
The Mule project is hosted on GitHub with a structured branching strategy:
- Feature/Bugfix Branches → Development work
- Development Branch → Integration environment
- Main Branch → Production-ready code
CI Pipeline (Continuous Integration)
Workflow: ci-build.yml
Triggers:
– Pull requests to main or development branches
– Pushes to feature/** or bugfix/** branches
Build & Test Job ( Test not added as part of training )
Validates code quality and functionality before merging:
- Checkout code from repository
- Setup JDK 17 (Temurin distribution)
- Configure Maven cache for faster builds
- Compile application (
mvn clean compile) - Execute unit tests (
mvn test) - Package Mule application JAR
- Upload build artifacts (5-day retention)
Artifact Output: server-info-1.7.4-mule-application.jar
Code Quality Job
Runs parallel security and validation checks:
- 🔍 XML configuration validation using
xmllint - 🔍 Security scanning for sensitive data
- 🔍 Detection of hardcoded passwords, secrets, API keys
CD Pipeline (Continuous Deployment)
Workflow: deploy-cloudhub2.yml
Triggers:
– Push to main or development branches
– Manual workflow dispatch with environment selection (dev/test/prod)
Deployment Stages
Stage 1: Version Management
Automated semantic versioning based on Git history:
Version Format: major.minor.commitCount
Example: 1.7.245
- Extracts current version from
pom.xml - Calculates commit count from repository history
- Updates
pom.xmlwith new version - Ensures unique version for each deployment
Stage 2: Build & Configuration
Environment setup and credential management:
- Setup JDK 17 with Maven caching
- Configure Maven
settings.xmlwith Anypoint credentials - Authenticate using Connected App (Client ID/Secret)
- Prepare deployment configuration
Secrets Used:
– ANYPOINT_CLIENT_ID_DEV
– ANYPOINT_CLIENT_SECRET_DEV
– ANYPOINT_ORG_ID
– ANYPOINT_ENV_ID_DEV
Stage 3: Publish to Anypoint Exchange
Artifact publication to MuleSoft’s asset repository:
mvn clean deploy -DskipTests -DskipMuleDeploy \ -Danypoint.orgId=d29ffee3-8e4b-4f13-bb0c-ea5ca175c2a9
- Publishes versioned artifact to Exchange
- Makes application available for reuse across organization
- Skips CloudHub deployment in this phase
Stage 4: Deploy to CloudHub 2.0
Production deployment with high availability configuration:
mvn deploy -DmuleDeploy \ -Dcloudhub.environment=Sandbox \ -Dcloudhub.applicationName=server-info-dev \ -Dcloudhub.target="Cloudhub-US-West-1" \ -Dcloudhub.replicas=2 \ -Dcloudhub.vCores=0.1
Deployment Configuration:
| Parameter | Value |
| Environment | Sandbox (DEV) |
| Application Name | server-info-dev |
| Region | US-West-1 |
| Replicas | 2 (High Availability) |
| vCores per Replica | 0.1 |
| Business Group | Cloud01Group0404Group04 |
Anypoint Platform Integration
Anypoint Exchange
Central repository for API assets and Mule applications:
- Stores versioned application artifacts
- Enables asset discovery and reuse
- Maintains deployment history
- Supports organizational governance
CloudHub 2.0 – DEV Environment
Deployment URL: https://server-info-dev.us-w2.cloudhub.io
Infrastructure: – Region: US-West-1 (Low latency for West Coast users) – Environment Type: Sandbox – High Availability: 2 replicas for zero-downtime deployments – Resource Allocation: 0.1 vCore per replica (suitable for dev/test workloads)
Replica Architecture:
┌─────────────────┐ ┌─────────────────┐
│ Replica 1 │ │ Replica 2 │
│ (0.1 vCore) │ │ (0.1 vCore) │
│ │ │ │
│ server-info │ │ server-info │
│ application │ │ application │
└─────────────────┘ └─────────────────┘
│ │
└──────────┬───────────┘
│
Load Balancer
Technology Stack
Runtime Environment
| Component | Version/Type |
| Java | 17 (Eclipse Temurin) |
| Mule Runtime | 4.10.1 |
| Build Tool | Apache Maven |
| CI/CD Platform | GitHub Actions |
Maven Configuration
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<mule.version>4.10.1</mule.version>
</properties>
Maven Options: -Xmx3072m (3GB heap for large builds)
Workflow Execution Flow
Developer Push/PR
↓
CI: Build & Test (Parallel)
├─→ Build Job (compile, test, package)
└─→ Quality Job (validate, scan)
↓
Code Review & Merge
↓
CD: Deploy Pipeline
├─→ Version Management
├─→ Build & Configure
├─→ Publish to Exchange
└─→ Deploy to CloudHub 2.0
↓
Live on CloudHub (2 replicas)
Environment Configuration
Current Environments
| Environment | Branch | CloudHub Env | URL |
| DEV | development | Sandbox | server-info-dev.us-w2.cloudhub.io |
| TEST | main | (Not configured) | – |
| PROD | main | (Not configured) | – |
Note: TEST and PROD environments can be added by extending the workflow with additional jobs and environment-specific secrets.
Monitoring & Observability
Build Artifacts
- Artifacts retained for 5 days
- Naming convention:
mule-application-pr-{number/sha} - Downloadable from GitHub Actions UI
Deployment Logs
Available in: – GitHub Actions workflow logs – Anypoint Runtime Manager – CloudHub application logs
Conclusion
The pipeline ensures consistent, repeatable deployments while maintaining code quality and security standards throughout the software delivery lifecycle.
References
- GitHub Repository: https://github.com/chandanrjit/server-info-ch04-20231128
- Workflow Files:
.github/workflows/ci-build.yml,.github/workflows/deploy-cloudhub2.yml - CloudHub Documentation: MuleSoft CloudHub 2.0
- Maven Deployment Plugin: Mule Maven Plugin