Skip to content

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

Terminal window
composer require albertoarena/laravel-netsons-deploy --dev

The service provider is auto-discovered by Laravel.

Run the installer

Terminal window
php artisan netsons:install

The wizard will ask you to choose a strategy, optionally configure environment variables, and guide you through setup.

The installer will:

  1. Publish config/netsons-deploy.php
  2. Set the strategy in the config file
  3. Optionally configure environment variables, build vars, custom commands, and Slack notifications (interactive mode)
  4. Generate .github/workflows/deploy.yml with all placeholders replaced
  5. Display required GitHub Secrets and Variables

Configure environment variables

Add custom .env variables for your deployment:

Terminal window
php artisan netsons:env add

Variable 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:

Terminal window
php artisan netsons:install --force

See Artisan Commands for full details.

Verify your setup

Terminal window
php artisan netsons:check

This 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:

Terminal window
# Overwrite existing config and workflow
php artisan netsons:install --strategy=git --force
# Interactive — will ask before overwriting
php artisan netsons:install

Using 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.