PHPackages                             albertoarena/laravel-netsons-deploy - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. albertoarena/laravel-netsons-deploy

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

albertoarena/laravel-netsons-deploy
===================================

Deploy Laravel applications to Netsons shared hosting via GitHub Actions (FTP or Git)

v1.12.0(3w ago)0311↑225%MITPHPPHP ^8.2CI passing

Since May 9Pushed yesterdayCompare

[ Source](https://github.com/albertoarena/laravel-netsons-deploy)[ Packagist](https://packagist.org/packages/albertoarena/laravel-netsons-deploy)[ RSS](/packages/albertoarena-laravel-netsons-deploy/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (7)Versions (40)Used By (0)

Laravel Netsons Deploy
======================

[](#laravel-netsons-deploy)

[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![Docs](https://camo.githubusercontent.com/96e9b40d076c15ebc2d801358cd3695879f931e4b154b8e5f861244e1417a0c8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63732d776562736974652d626c7565)](https://albertoarena.github.io/laravel-netsons-deploy/)[![Traffic](https://raw.githubusercontent.com/albertoarena/laravel-netsons-deploy/traffic-data/badge.svg)](https://raw.githubusercontent.com/albertoarena/laravel-netsons-deploy/traffic-data/badge.svg)

Deploy Laravel applications to **Netsons shared hosting** (cPanel, SSD plans) via GitHub Actions, supporting both **FTP upload** and **SSH/git-clone** strategies.

Features
--------

[](#features)

- Two deployment strategies: **FTP** (incremental sync) and **Git** (server-side clone)
- Release-based deployments with timestamped directories
- Zero-downtime release switching via proxy `index.php`
- Shared `.env` and `storage/` across releases
- Automatic cache clearing and rebuilding (with dependency caching for faster builds)
- Database migrations on deploy
- Automatic `key:generate` and seeder support on first deploy (auto-detects `spatie/laravel-permission`)
- Auto-detect env variables from `.env.example` (secret-backed and static, with editable values)
- Custom `.env` variable management (secret-backed and static values)
- Build environment variables (e.g., Vite config)
- Custom post-deploy artisan commands
- [Envaudit](https://albertoarena.github.io/envaudit/) `.env` validation (opt-in, default enabled)
- Slack deploy notifications (opt-in)
- `.htaccess` management for root and public directories
- Configurable FTP root path for different account setups
- Configurable release retention (prune old releases)
- SSH retry resilience (automatic retry on connection timeouts, configurable attempts/delay/timeout)
- SSH cleanup after every deploy
- Works with Netsons SSH (port 65100) and cPanel PHP (`ea-phpXX`)

Quick Start
-----------

[](#quick-start)

### 1. Install the package

[](#1-install-the-package)

```
composer require albertoarena/laravel-netsons-deploy --dev
```

### 2. Run the installer

[](#2-run-the-installer)

```
php artisan netsons:install
```

This will:

- Guide you through strategy selection (FTP or Git)
- Publish the config file to `config/netsons-deploy.php`
- Generate `.github/workflows/deploy.yml` with your settings
- Show the required GitHub Secrets and Variables

### 3. Configure environment variables

[](#3-configure-environment-variables)

```
php artisan netsons:env add
```

Add secret-backed variables (e.g., `DB_PASSWORD`), static values (e.g., `SESSION_DRIVER=database`), or build variables (e.g., `VITE_APP_NAME`).

### 4. Configure GitHub Secrets

[](#4-configure-github-secrets)

Add the required secrets to your GitHub repository (Settings &gt; Secrets and variables &gt; Actions). See [GitHub Secrets Reference](docs/github-secrets.md).

### 5. Deploy

[](#5-deploy)

Trigger the workflow from GitHub Actions &gt; Deploy to Netsons &gt; Run workflow.

Strategy Comparison
-------------------

[](#strategy-comparison)

FeatureFTPGit**How it works**Builds locally, uploads via FTPClones repo on server via SSH**PHP/Composer**On runner (uploaded with app)On server (runner skips PHP/Composer)**Node/Assets**On runner (uploaded with app)On runner, uploaded via SCP**Requires on server**FTP accessGit + SSH access (SSD 30+ plans)**Transfer method**Incremental FTP sync`git clone --depth 1`**Speed**Slower (full upload first time)Faster (shallow clone)**Best for**Any Netsons planSSD 30+ plans with git**Private repos**Supported (uploaded from runner)Supported via HTTPS + token> **Private repos with Git strategy:** Set `GIT_REPO` to the HTTPS URL and configure `GIT_TOKEN`. For same-repo deploys, use `${{ github.token }}`. See [Private Repository Setup](docs/github-secrets.md#private-repository-setup-git-strategy).

Usage as a Reusable GitHub Action
---------------------------------

[](#usage-as-a-reusable-github-action)

You can also use this as a reusable action in your workflow:

```
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      # ... build steps (PHP, Node, assets) ...

      - 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 [`action.yml`](action.yml) for all available inputs.

Artisan Commands
----------------

[](#artisan-commands)

### `netsons:install`

[](#netsonsinstall)

Interactive setup wizard. Publishes config and deploy workflow, shows required secrets/variables.

```
php artisan netsons:install
php artisan netsons:install --strategy=git
php artisan netsons:install --force   # Skip all confirmation prompts
```

### `netsons:check`

[](#netsonscheck)

Shows your local configuration, checks that the workflow file exists, and lists required GitHub Secrets/Variables.

```
php artisan netsons:check
```

### `netsons:env`

[](#netsonsenv)

Manage custom environment variables for deployment without editing the workflow manually.

```
php artisan netsons:env              # List all configured variables
php artisan netsons:env add          # Add a new variable (interactive)
php artisan netsons:env remove       # Remove a variable (interactive)
```

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/removing variables, regenerate the workflow:

```
php artisan netsons:install
```

The installer will prompt you to overwrite the existing workflow. Use `--force` to skip confirmation prompts.

Configuration
-------------

[](#configuration)

The config file `config/netsons-deploy.php` covers:

- **Strategy** — `ftp` or `git`
- **SSH** — host, port (default 65100), user, retry settings (retries, delay, timeout)
- **PHP binary** — remote path (default `/usr/local/bin/ea-php84`)
- **Deploy path** — remote directory (default `public_html`)
- **FTP** — host, port, user, password, protocol, root path
- **Git** — repo URL, branch
- **Releases** — number to keep (default 5)
- **Post-deploy** — toggle migrations, cache rebuilding, queue restart
- **Seeders** — classes to run on first deploy

The `netsons-deploy.json` file manages:

- **Secret-backed env vars** — mapped to GitHub Secrets
- **Static env vars** — fixed values per deployment
- **Build env vars** — available during asset build
- **Custom commands** — extra artisan commands for post-deploy
- **Seeders** — classes to run on first deploy only (auto-detected from `composer.json`)
- **Notifications** — Slack webhook for deploy alerts

See [Configuration Reference](docs/configuration.md) for details.

Documentation
-------------

[](#documentation)

- [Configuration Reference](docs/configuration.md)
- [FTP Strategy Guide](docs/ftp-strategy.md)
- [Git Strategy Guide](docs/git-strategy.md)
- [Netsons Setup Guide](docs/netsons-setup.md)
- [GitHub Secrets Reference](docs/github-secrets.md)
- [Troubleshooting](docs/troubleshooting.md)

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 10, 11, 12, or 13
- GitHub Actions
- Netsons shared hosting (cPanel, SSD plans)

Contributing
------------

[](#contributing)

Contributions are welcome! Please open an issue or submit a pull request.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/my-feature`)
3. Write tests for your changes
4. Ensure all tests pass (`composer test`)
5. Commit your changes
6. Push to the branch
7. Open a pull request

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance98

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

39

Last Release

22d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ed727b9cf4356b9a50c806a543eed4942cba0854795ac8d1430006e6e6d3be47?d=identicon)[albertoarena](/maintainers/albertoarena)

---

Top Contributors

[![albertoarena](https://avatars.githubusercontent.com/u/1126630?v=4)](https://github.com/albertoarena "albertoarena (77 commits)")

---

Tags

composercpaneldeploymentftpgithub-actionslaravelnetsonsphpshared-hostingsshftplaravelsshdeployGithub Actionscpanelnetsons

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/albertoarena-laravel-netsons-deploy/health.svg)

```
[![Health](https://phpackages.com/badges/albertoarena-laravel-netsons-deploy/health.svg)](https://phpackages.com/packages/albertoarena-laravel-netsons-deploy)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

9782.1M153](/packages/laravel-ai)[laravel/boost

Laravel Boost accelerates AI-assisted development by providing the essential context and structure that AI needs to generate high-quality, Laravel-specific code.

3.5k17.6M507](/packages/laravel-boost)[laravel/reverb

Laravel Reverb provides a real-time WebSocket communication backend for Laravel applications.

1.6k12.9M69](/packages/laravel-reverb)[livewire/flux

The official UI component library for Livewire.

9466.8M119](/packages/livewire-flux)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9732.3M121](/packages/roots-acorn)[fadion/maneuver

Easily deploy Laravel projects via FTP or SFTP, using Git for versioning.

1739.1k](/packages/fadion-maneuver)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
