https://github.com/guilhermestracini/poc-ghactions-ci-phplaravel
π¬ Proof of Concept of a Laravel (PHP) project using GitHub Actions for build, testing and deploy
https://github.com/guilhermestracini/poc-ghactions-ci-phplaravel
ci composer github-actions github-actions-composer github-actions-laravel github-actions-php hacktoberfest laravel packagist php phpunit poc proof-of-concept
Last synced: 4 months ago
JSON representation
π¬ Proof of Concept of a Laravel (PHP) project using GitHub Actions for build, testing and deploy
- Host: GitHub
- URL: https://github.com/guilhermestracini/poc-ghactions-ci-phplaravel
- Owner: GuilhermeStracini
- License: mit
- Created: 2024-04-13T00:24:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-23T21:42:57.000Z (4 months ago)
- Last Synced: 2025-06-23T22:39:40.204Z (4 months ago)
- Topics: ci, composer, github-actions, github-actions-composer, github-actions-laravel, github-actions-php, hacktoberfest, laravel, packagist, php, phpunit, poc, proof-of-concept
- Language: PHP
- Homepage: https://guilhermestracini.github.io/POC-GHActions-CI-PHPLaravel/
- Size: 544 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# π PoC GitHub Actions CI pipeline for Laravel (PHP)
[](https://wakatime.com/badge/github/GuilhermeStracini/POC-GHActions-CI-PHPLaravel)
[](https://github.com/GuilhermeStracini/POC-GHActions-CI-PHPLaravel)
[](https://github.com/GuilhermeStracini/POC-GHActions-CI-PHPLaravel)
[](https://github.com/GuilhermeStracini/POC-GHActions-CI-PHPLaravel/actions/workflows/build.yml)
[](https://github.com/GuilhermeStracini/POC-GHActions-CI-PHPLaravel/actions/workflows/deploy.yml)
[](https://github.com/GuilhermeStracini/POC-GHActions-CI-PHPLaravel/actions/workflows/php-lint.yml)
[](https://codeclimate.com/github/GuilhermeStracini/POC-GHActions-CI-PHPLaravel/maintainability)
[](https://codeclimate.com/github/GuilhermeStracini/POC-GHActions-CI-PHPLaravel/test_coverage)
[](https://www.codefactor.io/repository/github/GuilhermeStracini/POC-GHActions-CI-PHPLaravel)
---
π¬ **Proof of Concept (PoC)** for using **GitHub Actions** with a **Laravel (PHP)** project to automate CI/CD processes β including building, testing, code quality analysis, and deployment via FTP/SFTP.
---
## π¦ Whatβs in the box?
This project demonstrates a full CI/CD workflow using GitHub Actions:
### β
CI - Continuous Integration
- π₯ **Checkout code** from the repository
- π§° **Set up environment**:
- PHP
- Composer
- Java (required for SonarCloud Scanner)
- πΎ **Cache dependencies**:
- Composer packages
- SonarCloud binaries
- π¨ **Build the project**
- π§ͺ **Run tests**
- π§Ή **Static analysis & quality gates** using:
- SonarCloud
- Code Climate
- Codecov
- CodeFactor
- Snyk
- π΅οΈ **Lint PHP files** for syntax errors
### π CD - Continuous Deployment
- π€ Upload built artifacts via **FTP/SFTP**
- π SSH into the remote server and **execute deployment commands**
- π© Optional: trigger manual approval for deployment (via `workflow_dispatch` or `environment protection rules`)
---
## π Detailed guide
π Refer to the blog post for a deep dive into how this works:
> π [**Using GitHub Actions to create a Laravel (PHP) pipeline. Build, test, and deploy!**](https://blog.guilhermebranco.com.br/using-github-actions-to-create-a-laravel-php-pipeline-build-test-and-deploy/)
---
## π Repository structure
```
.github/
workflows/
build.yml # Build & test workflow
deploy.yml # Deploy to (S)FTP server
php-lint.yml # Lint PHP files
.env.example # Example environment file
composer.json # Laravel dependencies
README.md # This file
```
---
## βοΈ Requirements
To replicate this setup, make sure you have:
- Laravel project setup with `composer install`
- (S)FTP credentials or SSH access to your server
- GitHub secrets configured:
- `SFTP_HOST`, `SFTP_USERNAME`, `SFTP_PASSWORD`, etc.
- A basic understanding of GitHub Actions workflows
---
## β€οΈ Contributing
This is a PoC, but feel free to fork, experiment, or suggest improvements via PRs or issues!
---
## π License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.