Bluewoo HRMS
Deployment

Deployment

Infrastructure, CI/CD, and environment strategy

Deployment

This section covers the complete deployment infrastructure for HRMS projects, from local development to production.

Live Example

HRMS Documentation: https://docs.hrms.bluewoo.com

This documentation site is deployed using the exact setup described in these guides.


GuideDescription
Development WorkflowStart here - Branch → PR → Deploy process
Local DevelopmentDocker setup for local development
Infrastructure SetupGCP project and resource configuration
CI/CD PipelineGitHub Actions workflow
Load Balancer SetupCustom domain with managed SSL
Domain SetupDNS configuration

Multi-Service Guides (HRMS App)

GuideDescription
Multi-Service CI/CDGitHub Actions for HRMS (web, api, ai)
Cloud SQL SetupPostgreSQL on Google Cloud SQL
MongoDB Atlas SetupVector database for AI service
Secret Manager SetupSecure credential storage
Redis Memorystore SetupCaching and session storage

Infrastructure Overview

ServicePlatformPurpose
ContainersCloud RunAuto-scaling serverless containers
RegistryArtifact RegistryDocker image storage
Load BalancerGlobal External LBCustom domains + SSL
DatabaseCloud SQL (PostgreSQL 17)Relational data
VectorsMongoDB AtlasAI embeddings
FilesCloud StorageDocument storage
CacheCloud Memorystore (Redis)Session/data cache
SecretsSecret ManagerAPI keys, credentials
CI/CDGitHub ActionsAutomated deployments

Architecture

hrms-docs (Current Setup)

                         ┌──────────────────────────────────────┐
                         │         docs.hrms.bluewoo.com        │
                         └──────────────────┬───────────────────┘


                         ┌──────────────────────────────────────┐
                         │       Global Load Balancer            │
                         │       IP: 34.8.128.20                 │
                         │       SSL: Managed Certificate        │
                         └──────────────────┬───────────────────┘


                         ┌──────────────────────────────────────┐
                         │          Cloud Run                    │
                         │          (hrms-docs)                  │
                         │          europe-west6                 │
                         └──────────────────────────────────────┘

HRMS App (Full Stack)

                    ┌─────────────────────────────────────┐
                    │         Cloud Run Services          │
                    │                                     │
                    │  ┌─────────┐  ┌─────────┐  ┌─────┐ │
                    │  │Frontend │  │ Backend │  │ AI  │ │
                    │  │(Next.js)│  │(NestJS) │  │Svc  │ │
                    │  └────┬────┘  └────┬────┘  └──┬──┘ │
                    └───────│───────────│──────────│─────┘
                            │           │          │
              ┌─────────────┴───────────┴──────────┴─────────────┐
              │                                                   │
              ▼                                                   ▼
    ┌─────────────────┐                                 ┌─────────────────┐
    │    Cloud SQL    │                                 │  MongoDB Atlas  │
    │  (PostgreSQL)   │                                 │   (Vectors)     │
    └─────────────────┘                                 └─────────────────┘


    ┌─────────────────┐
    │  Cloud Storage  │
    │   (Documents)   │
    └─────────────────┘

Environment Strategy

EnvironmentPurposeDeployment TriggerURL Pattern
LocalDevelopmentManuallocalhost:3000
PreviewPR testingAutomatic on PRpr-{n}.run.app
StagingUAT/QAMerge to main*-staging.run.app
ProductionLive usersAfter staging*.hrms.bluewoo.com

CI/CD Pipeline

┌────────┐   ┌──────┐   ┌───────┐   ┌─────────┐   ┌────────────┐
│ Commit │ → │ Lint │ → │ Test  │ → │  Build  │ → │  Deploy    │
│        │   │      │   │       │   │ (Docker)│   │  Staging   │
└────────┘   └──────┘   └───────┘   └─────────┘   └─────┬──────┘


                                                 ┌────────────┐
                                                 │  Deploy    │
                                                 │ Production │
                                                 └────────────┘

See CI/CD Pipeline for detailed workflow configuration.


Deployment Rules

  1. All deployments through CI/CD - no manual deploys to staging/production
  2. Staging deploys automatically on merge to main
  3. Production deploys after staging (can add manual approval)
  4. Secrets in Secret Manager - never committed to repository
  5. Rollback via Cloud Run revisions

Key Architecture Decisions

DecisionRationale
Cloud Run over GKECost-effective for current scale, scales to zero
Load Balancer for domainsWorks with any region, managed SSL
Artifact RegistryNative GCP integration, vulnerability scanning
GitHub ActionsFree tier, excellent integration, AI agent support
Workload IdentityNo service account keys to manage
europe-west6 (Zurich)Swiss data privacy, EU compliance

Cost Estimate

hrms-docs (Current)

ResourceMonthly Cost
Cloud Run (staging + prod)$15-45
Load Balancer$18
Artifact Registry$1-5
Total~$35-70/month

HRMS App (Future)

ResourceMonthly Cost
Cloud Run (3 services)$30-80
Cloud SQL$10-50
Redis Memorystore$30-50
Load Balancer$18
Total~$90-200/month

Getting Started

For hrms-docs (Simple)

  1. Infrastructure Setup - Create GCP project
  2. CI/CD Pipeline - Set up GitHub Actions
  3. Load Balancer Setup - Configure custom domain
  4. Domain Setup - DNS configuration

For HRMS App (Full Stack)

Follow Phase 11: Production Deployment which covers:

  1. Cloud SQL Setup - PostgreSQL database
  2. MongoDB Atlas Setup - Vector database
  3. Secret Manager Setup - Credentials
  4. Redis Memorystore Setup - Caching
  5. Multi-Service CI/CD - Deploy 3 services

Rollback Strategy

# List revisions
gcloud run revisions list --service=hrms-docs --region=europe-west6

# Rollback to previous revision
gcloud run services update-traffic hrms-docs \
  --to-revisions=PREVIOUS_REVISION=100 \
  --region=europe-west6

Last updated: December 2025 - Verified and deployed to production