This repository demonstrates a modern CI/CD pipeline built using GitHub Actions. It focuses on automating the validation, build, and deployment readiness of a containerized Laravel application, ensuring that only high-quality, tested code reaches production.
The pipeline is designed to handle both frontend and backend assets through isolated, optimized build environments:
- Continuous Integration (CI):
- Linting & Code Quality: Automatic checks for PHP and JavaScript styling.
- Automated Testing: Runs the PHPUnit suite to ensure business logic integrity.
- Environmental Isolation: Uses
.env.cito manage pipeline-specific variables.
- Continuous Deployment (CD) Readiness:
- Multi-Stage Docker Builds:
Dockerfile.php: Optimized for high-performance PHP-FPM serving.Dockerfile.node: Handles Vite/Tailwind asset compilation.
- Artifact Management: Generates production-ready images ready to be pushed to a registry.
- Multi-Stage Docker Builds:
- Workflow Engine: GitHub Actions
- Application: Laravel 11.x
- Containerization: Docker & Docker Compose
- Environment: PHP 8.2+, Node.js 20+
- Testing: PHPUnit
| Component | Responsibility |
|---|---|
.github/workflows/ |
Declarative YAML files defining the pipeline stages. |
Dockerfile.php |
The PHP-FPM container configuration. |
Dockerfile.node |
The Node.js environment for frontend build steps. |
docker-compose.yml |
Local orchestration for dev/testing environments. |
.env.ci |
Configuration tailored for the GitHub Actions runner. |
- Clone the repository:
git clone [https://github.com/shashidas95/basic_ci_cd.git](https://github.com/shashidas95/basic_ci_cd.git)
- Setup Containers:
docker-compose up -d
The pipeline is configured to trigger automatically on:
- Every
pushto themainbranch. - Every
pull_requesttargeting themainbranch.
Shashi Kanta Das Software Architect | DevOps Engineer | Assistant Director @ BSTI