This folder contains GitHub Actions workflows with an intelligent CI/CD system for the Idem monorepo.
Trigger:
- Push to
main,develop,dev,master - Pull requests to
main,develop,dev,master
Description: Unified workflow that automatically detects modified applications, runs quality checks, builds only changed apps, and deploys them.
Jobs:
- ๐ detect-changes - Detects modified applications and packages with
dorny/paths-filter@v3 - โ quality - Runs format check and linting (only if changes detected)
- ๐ deploy-api - Deploys API (only on push to main/dev/master)
- ๐ deploy-landing - Deploys Landing Page (only on push to main/dev/master)
- ๐ deploy-main-dashboard - Deploys Main Dashboard (only on push to main/dev/master)
- ๐ deploy-chart - Deploys Chart (only on push to main/master)
- ๐ summary - Generates build and deployment summary
Benefits:
- โก 60-70% faster - Only modified apps are built and deployed
- ๐ฐ Cost savings - Reduced CI/CD minutes
- ๐ Visibility - Clear build and deployment summaries
- ๐ง Maintenance - Single unified workflow
- ๐ฏ Smart - No unnecessary builds or deployments
Summary Example:
๐ CI/CD Summary
Changes Detected:
- API: โ
Changed
- Landing Page: โญ๏ธ No changes
- Main Dashboard: โญ๏ธ No changes
- Chart: โญ๏ธ No changes
- AppGen: โญ๏ธ No changes
- Packages: โญ๏ธ No changes
Deployments:
- API: โ
Deployed
- Landing Page: โญ๏ธ Skipped
- Main Dashboard: โญ๏ธ Skipped
- Chart: โญ๏ธ Skipped
Status: ci.yml
Trigger: Manual only (workflow_dispatch)
This workflow is kept for reference but is no longer used. All smart deploy logic is now in ci.yml.
Type: Reusable workflow (workflow_call)
Trigger:
- Called by
ci.yml(when API changes detected on push to main/dev/master) - Manual via
workflow_dispatch
Description: Deploys the backend API (Express/TypeScript)
Jobs:
- ๐ง build - Build Docker image on remote server
- ๐ค push - Push image to GitHub Container Registry
- ๐ deploy - Deployment with docker-compose
Environments:
production(mainbranch)staging(devbranch)
Required Secrets:
SERVER_HOST # Server host
SERVER_USER # SSH user
SSH_PRIVATE_KEY # SSH private keyType: Reusable workflow (workflow_call)
Trigger:
- Called by
ci.yml(when Landing Page changes detected on push to main/dev/master) - Manual via
workflow_dispatch
Description: Deploys the landing page (Angular with SSR and @angular/localize)
Jobs:
- ๐ง build - Build Docker image on remote server
- ๐ค push - Push image to GitHub Container Registry
- ๐ deploy - Deployment with docker-compose
Environments:
production(mainbranch)staging(devbranch)
Required Secrets:
SERVER_HOST # Server host
SERVER_USER # SSH user
SSH_PRIVATE_KEY # SSH private keyType: Reusable workflow (workflow_call)
Trigger:
- Called by
ci.yml(when Main Dashboard changes detected on push to main/dev/master) - Manual via
workflow_dispatch
Description: Deploys the main dashboard (Angular with ngx-translate)
Jobs:
- ๐ง build - Build Docker image on remote server
- ๐ค push - Push image to GitHub Container Registry
- ๐ deploy - Deployment with docker-compose
Environments:
production(mainbranch)staging(devbranch)
Required Secrets:
SERVER_HOST # Server host
SERVER_USER # SSH user
SSH_PRIVATE_KEY # SSH private keyType: Reusable workflow (workflow_call)
Trigger:
- Called by
ci.yml(when Chart changes detected on push to main/master) - Manual via
workflow_dispatch
Description: Deploys the diagram editor (SvelteKit) to GitHub Pages
Jobs:
- ๐ง build - Build with pnpm and SvelteKit
- ๐ deploy - Deployment to GitHub Pages
Environment: github-pages
Required Permissions:
pages: write
id-token: writeโ Multiple workflows running in parallel (ci.yml + smart-deploy.yml + individual workflows)
โ All projects built and deployed on every push
โ Fixed time: 15-20 minutes
โ No change detection
โ Workflow duplication
โ Wasted CI/CD minutes
โ
Single unified workflow (ci.yml)
โ
Build and deploy only changed applications
โ
Variable time: 1-20 minutes depending on changes
โ
Automatic detection with paths-filter
โ
Reusable deployment workflows (workflow_call)
โ
Automatic build and deployment summary
โ
Quality checks only when needed
โ
60-90% time savings on typical commits
| Scenario | Before | After | Gain |
|---|---|---|---|
| 1 modified project | 15 min | 3-5 min | 70% โก |
| 2 modified projects | 15 min | 6-8 min | 50% โก |
| All projects | 15 min | 12-15 min | 0-20% |
| Packages only | 15 min | 2-3 min | 85% โก |
| No changes | 15 min | 1-2 min | 90% โก |
- Minutes saved: ~400-500 min/month
- Cost reduction: 60-70%
- PR feedback: 3x faster
Settings โ Secrets and variables โ Actions
GITHUB_TOKEN # Provided by GitHub Actions# For API, Landing Page, and Main Dashboard
SERVER_HOST # Deployment server host
SERVER_USER # SSH user
SSH_PRIVATE_KEY # SSH private keySettings โ Environments
production-mainbranchstaging-devbranchgithub-pages- For Chart Editor
# 1. Create a branch
git checkout -b feature/my-feature
# 2. Modify an application
cd apps/api
# ... modifications ...
# 3. Commit and push
git add .
git commit -m "feat(api): add new endpoint"
git push origin feature/my-feature
# 4. Merge to dev or main
git checkout dev
git merge feature/my-feature
git push origin dev
# 5. Automatic Deployment
# โ
Smart Deploy detects: only apps/api changed
# โ
Deploy: deploys API only
# โฑ๏ธ Total time: ~5-7 minutes (vs 15-20 minutes)Trigger a specific deployment:
- GitHub โ Actions
- Select the workflow (e.g., Deploy API)
- Click on Run workflow
- Select the branch
- Click on Run workflow
graph LR
A[Push to main/dev] --> B[Checkout code]
B --> C[dorny/paths-filter]
C --> D[Analyze modified files]
D --> E[Compare with patterns]
E --> F[Generate boolean outputs]
F --> G[Trigger conditional workflows]
G --> H[Selective deployments]
Modification: apps/api/src/controllers/user.controller.ts
Detection:
๐ Changes detected:
- apps/api/** : true
- apps/landing/** : false
- apps/main-dashboard/** : false
- apps/chart/** : false
- apps/appgen/** : false
- packages/** : false
Jobs executed:
โ
deploy-api : Build, Push, Deploy
Jobs skipped:
โญ๏ธ deploy-landing
โญ๏ธ deploy-main-dashboard
โญ๏ธ deploy-chart
โฑ๏ธ Time: 5-7 minutes (vs 15-20 minutes)
๐ฐ Savings: 65-70%Legacy workflows have been disabled and renamed with the .disabled extension:
apps/api/.github/workflows/
โโโ deploy.yml.disabled # โ Disabled
apps/landing/.github/workflows/
โโโ (no legacy workflows) # โ
New application
apps/main-dashboard/.github/workflows/
โโโ (no legacy workflows) # โ
New application
apps/chart/.github/workflows/
โโโ deploy.yml.disabled # โ Disabled
โโโ docker-publish.yml # โ
Active
โโโ tests.yml # โ
Active
โโโ ... # โ
Other active workflows
Strategy: Complete migration
- New Smart Deploy workflows at root
- Legacy deployment workflows disabled
- Can be deleted after validation
- documentation/SMART_DEPLOY.md - Complete Smart Deploy guide
- documentation/README.md - Documentation index
- dorny/paths-filter - Change detection action
- GitHub Actions - Reusing Workflows
- GitHub Actions - Documentation GitHub
Check:
- Modifications are in
apps/*/ - Branch is
main,dev, ormaster - Review
detect-changesjob logs
Check:
- Branch name in
on.push.branches - Workflow permissions
- Secrets configured in Settings โ Secrets
Check:
- SSH secrets configured (
SERVER_HOST,SERVER_USER,SSH_PRIVATE_KEY) - Server accessible from GitHub Actions
- Docker installed on server
- GitHub environments configured
Normal before first push:
- These lint errors disappear after pushing workflows
- Linter checks remote repository which doesn't have files yet
# โ
Good - One application per commit
git commit -m "feat(api): add user endpoint"
# โ Bad - Modifications everywhere
git commit -m "feat: update everything"git checkout -b feature/api-user-endpoint
# Modifications only in apps/apicd apps/api
npm run lint
npm run test
npm run build- Check summary in GitHub Actions
- Monitor deployment times
- Verify deployed vs skipped applications
- Automatic tests before deployment
- Automatic rollback on failure
- Notifications Slack/Discord for deployments
- Metrics for deployment performance
- Preview deployments for PRs
To add a new application to the Smart Deploy system, see the complete guide in documentation/SMART_DEPLOY.md
CI/CD Workflows optimized with Smart Deploy! ๐ฏ
For more details: documentation/SMART_DEPLOY.md