Manual deployments are error-prone and time-consuming. I set up automated CI/CD pipelines that test your code, build your application, and deploy to production with confidence—all triggered by a simple git push.
What Is CI/CD?
Continuous Integration (CI)
Every code change is automatically:
- Built and compiled
- Tested against your test suite
- Analyzed for code quality
- Checked for security vulnerabilities
Continuous Deployment (CD)
Passing code is automatically:
- Packaged for deployment
- Deployed to staging environment
- Promoted to production (with approval if desired)
- Monitored for issues
Why You Need CI/CD
Eliminate Human Error
- No more "I forgot to run migrations"
- Consistent deployment every time
- No manual file transfers
- Environment parity guaranteed
Deploy with Confidence
- Code tested before it reaches production
- Easy rollback if something breaks
- Audit trail of all deployments
- Team visibility into deployment status
Ship Faster
- Deploy multiple times per day
- Reduce time from code to production
- Quick fixes deployed in minutes
- No waiting for "the deployment person"
Better Code Quality
- Tests run on every commit
- Code style enforcement
- Security scanning
- Performance regression detection
Platforms I Work With
GitHub Actions
GitHub's built-in CI/CD:
- Tight integration with GitHub
- Generous free tier
- Huge marketplace of actions
- Matrix builds for multiple PHP versions
GitLab CI/CD
GitLab's powerful pipeline system:
- Self-hosted or cloud
- Built-in container registry
- Environment management
- Review apps for merge requests
Bitbucket Pipelines
Atlassian's CI/CD solution:
- Integration with Jira and Confluence
- Simple YAML configuration
- Built-in deployment tracking
Jenkins
Self-hosted flexibility:
- Complete control
- Extensive plugin ecosystem
- Complex workflow support
Pipeline Components I Configure
Build Stage
- name: Install Dependencies
run: composer install --no-interaction --prefer-dist
- name: Build Assets
run: npm ci && npm run build
What happens:
- Install PHP dependencies (Composer)
- Install Node dependencies (npm/yarn)
- Build frontend assets (Vite/Webpack)
- Generate necessary files
Test Stage
- name: Run Tests
run: php artisan test --parallel
- name: Run Static Analysis
run: vendor/bin/phpstan analyse
What happens:
- Unit and feature tests (PHPUnit/Pest)
- Static analysis (PHPStan/Larastan)
- Code style checking (Pint/PHP-CS-Fixer)
- Security vulnerability scanning
Deploy Stage
- name: Deploy to Production
run: |
ssh ${{ secrets.SERVER }} "cd /var/www/app && git pull"
ssh ${{ secrets.SERVER }} "cd /var/www/app && composer install --no-dev"
ssh ${{ secrets.SERVER }} "cd /var/www/app && php artisan migrate --force"
What happens:
- Connect to server securely
- Pull latest code
- Install dependencies
- Run migrations
- Clear and rebuild caches
- Restart workers if needed
Deployment Strategies
Basic Deployment
Simple git pull strategy:
- Pull code from repository
- Install dependencies
- Run migrations
- Clear caches
- Downtime: 5-30 seconds
Zero-Downtime Deployment
Using tools like Envoy, Deployer:
- Build in separate directory
- Symlink switch when ready
- Instant atomic deployment
- Downtime: 0 seconds
Blue-Green Deployment
Run two production environments:
- Deploy to inactive environment
- Test the new deployment
- Switch traffic
- Easy rollback
Canary Deployment
Gradual rollout:
- Deploy to subset of servers
- Monitor for issues
- Gradually increase traffic
- Full rollout when confident
Environment Management
Staging Environment
- Automatically deployed from
developbranch - Complete production mirror
- Test new features before production
- Client demonstration environment
Production Environment
- Deployed from
mainbranch - Optional manual approval gate
- Automatic after staging approval
- Rollback capability
Feature Environments
- Deploy each feature branch
- Isolated testing environments
- Auto-cleanup when merged
- Review app functionality
What I Set Up
Standard Pipeline Package
Essential automated deployment:
- Build and test automation
- Deployment to staging
- Manual production deployment trigger
- Basic notification setup
- Documentation
Advanced Pipeline Package
Full DevOps automation:
- Everything in Standard
- Zero-downtime deployments
- Automated production deployment
- Environment management
- Secrets management
- Monitoring integration
- Rollback procedures
Example Workflow
Here's what a typical Laravel CI/CD pipeline includes:
| Stage | Actions |
|---|---|
| Install | Composer install, npm install |
| Build | npm run build, optimize autoloader |
| Lint | Pint, ESLint, Prettier |
| Test | PHPUnit/Pest, browser tests |
| Analyze | PHPStan, security checks |
| Deploy Staging | Auto-deploy to staging |
| Deploy Production | Manual approval, zero-downtime |
Notifications & Monitoring
Deployment Notifications
- Slack/Discord messages
- Email notifications
- GitHub/GitLab comments
- Custom webhooks
Failure Alerts
- Immediate failure notifications
- Error context and logs
- Quick access to failed jobs
Getting Started
What I Need From You
- Repository access (GitHub/GitLab/Bitbucket)
- Server access (SSH keys)
- Environment details
- Current deployment process (if any)
Timeline
| Setup Type | Duration |
|---|---|
| Basic Pipeline | 1-2 days |
| Standard Pipeline | 2-3 days |
| Advanced Pipeline | 3-5 days |
Stop Deploying Manually
Let's automate your deployment process and give you confidence in every release.
Connect with me:
- GitHub: @iperamuna
- LinkedIn: Indunil Peramuna
- WhatsApp: +94 77 767 1771
- Telegram: @iperamuna