AT
GitHub Actions CI/CD for Laravel - my production workflow
Sharing my GitHub Actions workflow that I use for deploying Laravel apps. It runs PHPStan, Pint, and PHPUnit before deploying via SSH.
The workflow has two jobs:
1. Test job: Checkout code, setup PHP 8.3, composer install, run vendor/bin/pint --test, run vendor/bin/phpstan analyse, run php artisan test.
2. Deploy job (depends on test passing): rsync files to server, run composer install --no-dev, clear and rebuild caches.
The key insight: always run Pint in --test mode in CI. It catches formatting issues without modifying files. Also running PHPStan at level 8 catches so many bugs before they reach production.
Full workflow file is around 80 lines. Happy to share the complete version if anyone is interested.