Installation
Requirements
- PHP 8.2 or higher
- Laravel 10, 11, 12, or 13
- GitHub Actions (for deployment)
- Netsons shared hosting (cPanel, SSD plans)
Install via Composer
composer require albertoarena/laravel-netsons-deploy --devThe service provider is auto-discovered by Laravel.
Run the installer
php artisan netsons:installThe wizard will ask you to choose a strategy, optionally configure environment variables, and guide you through setup.
php artisan netsons:install --strategy=ftp# orphp artisan netsons:install --strategy=gitThe installer will:
- Publish
config/netsons-deploy.php - Set the strategy in the config file
- Optionally configure environment variables, build vars, custom commands, and Slack notifications (interactive mode)
- Generate
.github/workflows/deploy.ymlwith all placeholders replaced - Display required GitHub Secrets and Variables
Configure environment variables
Add custom .env variables for your deployment:
php artisan netsons:env addVariable types:
- Secret-backed — values from GitHub Secrets (e.g.,
DB_PASSWORD) - Static — fixed values (e.g.,
SESSION_DRIVER=database) - Build — available during asset build (e.g.,
VITE_APP_NAME)
After adding variables, regenerate the workflow:
php artisan netsons:install --forceSee Artisan Commands for full details.
Verify your setup
php artisan netsons:checkThis shows your local configuration, checks that the workflow file exists, displays netsons-deploy.json status, and lists required GitHub Secrets/Variables. Credentials (SSH, FTP, Git) are configured via GitHub Secrets — the check command does not validate them locally.
Re-running the installer
If you need to change strategies or re-publish the config:
# Overwrite existing config and workflowphp artisan netsons:install --strategy=git --force
# Interactive — will ask before overwritingphp artisan netsons:installUsing as a GitHub Action
You can also use this package as a reusable GitHub Action without installing it via Composer:
- uses: albertoarena/laravel-netsons-deploy@v1 with: strategy: 'git' environment: 'production' deploy-path: 'public_html' ssh-host: ${{ vars.SSH_HOST }} ssh-user: ${{ vars.SSH_USER }} ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }} git-repo: ${{ vars.GIT_REPO }}See GitHub Action Reference for all inputs.