Overview
The BE Monorepo uses GitHub Actions for automated testing, linting, and releases. The CI/CD pipeline ensures code quality and streamlines the deployment process.Workflow Files
The project includes two main GitHub Actions workflows located in.github/workflows/:
- CI Workflow (
ci.yml) - Continuous integration for pull requests and main branch - Release Workflow (
release.yml) - Automated releases on version tags
CI Workflow
Trigger Events
The CI workflow runs on:Jobs
1. Sherif - Monorepo Linting
Validates monorepo structure and dependencies:- Dependency version consistency across workspace packages
- Package.json fields compliance
- Workspace structure validation
2. Lint and Type Check
Runs code quality checks:bun ci- Installs dependencies (CI-optimized)bun lint-typecheck- Runs parallel linting and TypeScript type checking
lint-typecheck script executes:
- Lint:
ultracite check(code style and quality) - TypeCheck:
tsc --noEmit(TypeScript type validation)
Release Workflow
Trigger Events
The release workflow runs when version tags are pushed:Permissions
Release Job
Automatically generates changelog and GitHub releases:- Checks out entire git history
- Sets up Node.js LTS
- Runs
changelogithubto generate release notes from commits - Creates a GitHub release automatically
Creating Releases
Using Changesets
The project uses Changesets for version management:Environment Variables
Built-in Environment Variables
Required Secrets
The workflows use GitHub’s built-in secrets:GITHUB_TOKEN- Automatically provided by GitHub Actions
No additional secrets are required for the current CI/CD setup.
Local CI Simulation
Run the same checks locally before pushing:CI/CD Best Practices
Pre-commit Hooks
The project uses Husky for pre-commit hooks:Dependency Management
Update dependencies safely:Caching Strategy
The workflows use implicit caching:- Bun setup action caches dependencies automatically
- Checkout action uses shallow clones for speed
Extending CI/CD
Adding Test Jobs
To add automated testing:Adding Build Validation
Validate production builds in CI:Database Integration
For testing with a real database:Deployment Automation
Example Deployment Workflow
Add a deployment step after successful CI:Environment-specific Deployments
Use GitHub Environments for staged deployments:Monitoring CI/CD
Viewing Workflow Runs
Monitor CI/CD in your GitHub repository:- Navigate to the Actions tab
- View workflow runs and their status
- Click on a run to see detailed logs
- Review failed jobs and error messages
Workflow Status Badge
Add a status badge to your README:Troubleshooting
Common Issues
Sherif fails:- Check dependency versions across packages
- Ensure all packages use the same version of shared dependencies
- Review workspace configuration
- Run locally:
bun lint-typecheck - Fix errors before pushing
- Ensure all files are included in TypeScript config
- Verify tag format matches
v*pattern - Check repository permissions
- Ensure tag is pushed:
git push origin v1.0.0
Debug Mode
Enable step debugging in workflows:Next Steps
Docker Setup
Configure containers for deployment
Production Build
Optimize builds for production
