Skip to content

Configuration

The configuration file is published to config/netsons-deploy.php.

Strategy

'strategy' => env('NETSONS_DEPLOY_STRATEGY', 'ftp'),

Choose between ftp or git. See FTP Strategy and Git Strategy.

SSH

'ssh' => [
'host' => env('NETSONS_SSH_HOST'),
'port' => env('NETSONS_SSH_PORT', 65100),
'user' => env('NETSONS_SSH_USER'),
],

Port defaults to 65100 — the standard SSH port on Netsons shared hosting.

PHP Binary

'php_binary' => env('NETSONS_PHP_BINARY', '/usr/local/bin/ea-php84'),

Common values: /usr/local/bin/ea-php82, ea-php83, ea-php84.

Deploy Path

'deploy_path' => env('NETSONS_DEPLOY_PATH', 'public_html'),

Remote directory relative to your home directory.

FTP Settings

'ftp' => [
'host' => env('NETSONS_FTP_HOST'),
'port' => env('NETSONS_FTP_PORT', 21),
'user' => env('NETSONS_FTP_USER'),
'password' => env('NETSONS_FTP_PASS'),
'protocol' => env('NETSONS_FTP_PROTOCOL', 'ftp'),
'root_path' => env('NETSONS_FTP_ROOT_PATH', ''),
],

Only used with the FTP strategy.

FTP Root Path

The root_path controls how the FTP server-dir is computed:

  • Empty (default) — FTP root is your home directory (/home/user/). The workflow uses DEPLOY_PATH/releases/....
  • Set to site directory — FTP root is scoped to the site (/home/user/mysite.com/). The workflow uses releases/... directly.

Check your FTP root in cPanel > Files > FTP Accounts > Configure FTP Client.

Git Settings

'git' => [
'repo' => env('NETSONS_GIT_REPO'),
'branch' => env('NETSONS_GIT_BRANCH', 'main'),
],

Only used with the Git strategy. Use SSH format for the repo URL.

Release Management

'releases' => [
'keep' => env('NETSONS_RELEASES_KEEP', 5),
],

Number of releases to retain. Older releases are removed after each deployment.

.htaccess

'htaccess' => [
'root' => true,
'public' => true,
],
  • root — rewrites all requests to the public/ subdirectory
  • public — ensures Laravel’s rewrite rules are in public/.htaccess

Environments

'environments' => [
'stage' => ['htaccess_root' => true],
'production' => ['htaccess_root' => true],
],

Per-environment overrides.

.env Mapping

'env_mapping' => [
// 'DB_PASSWORD' => 'PROD_DB_PASSWORD',
],

Maps .env keys to GitHub secret names for injection during deployment.

Post-Deploy

'post_deploy' => [
'clear_cache' => true,
'migrate' => true,
'cache_config' => true,
'cache_routes' => true,
'cache_views' => true,
'cache_events' => true,
'queue_restart' => true,
],

Toggle individual post-deploy steps. The workflow always runs package:discover --ansi before cache commands.

Seeders

'seeders' => [
// 'RoleSeeder',
// 'PermissionSeeder',
],

Run on the first deploy only. A .first_deploy flag file controls this.


netsons-deploy.json

The netsons-deploy.json file in your project root stores additional deployment configuration. It is created by netsons:install and managed by netsons:env.

During netsons:install, the installer auto-detects variables from your .env.example:

  • Secret-backedDB_DATABASE, DB_USERNAME, DB_PASSWORD, MAIL_USERNAME, MAIL_PASSWORD, REDIS_PASSWORD, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
  • Static — any key with a non-placeholder value, excluding infrastructure prefixes and placeholder values

Static values can be edited after selection. When reconfiguring, the JSON is reset to defaults.

Schema

{
"env_mapping": {
"DB_DATABASE": "DB_DATABASE",
"DB_USERNAME": "DB_USERNAME",
"DB_PASSWORD": "DB_PASSWORD"
},
"env_static": {
"SESSION_DRIVER": "database",
"LARAVEL_PDF_DRIVER": "dompdf"
},
"build_env": {
"VITE_APP_NAME": "My App"
},
"custom_commands": [
"event-sourcing:cache-event-handlers 2>/dev/null || true"
],
"notifications": {
"slack_webhook_secret": "SLACK_WEBHOOK_DEBUG"
}
}

env_mapping

Maps .env variable names to GitHub Secret names. Values are injected into the remote .env file with proper sed escaping for special characters.

env_static

Static .env values that are fixed per deployment (not from secrets). Written directly into the workflow.

"env_static": {
"SESSION_DRIVER": "database",
"LARAVEL_PDF_DRIVER": "dompdf"
}

build_env

Environment variables available during the asset build step (yarn build / npm run build).

"build_env": {
"VITE_APP_NAME": "My Application"
}

custom_commands

Additional artisan commands for the post-deploy cache rebuild phase. Run after standard cache commands and before queue:restart.

"custom_commands": [
"event-sourcing:cache-event-handlers 2>/dev/null || true",
"permission:cache-reset"
]

Common examples:

PackageCommand
Spatie Event Sourcingevent-sourcing:cache-event-handlers 2>/dev/null || true
Spatie Permissionpermission:cache-reset
Laravel Horizonhorizon:terminate
Laravel Telescopetelescope:prune
Laravel Scoutscout:sync-index-settings

notifications

Optional Slack deploy notifications.

"notifications": {
"slack_webhook_secret": "SLACK_WEBHOOK_DEBUG"
}

The value is the GitHub Secret name containing the Slack webhook URL.

envaudit

Enables envaudit .env validation after deployment. When enabled, the workflow downloads the remote .env and validates it before proceeding with migrations.

"envaudit": true

See the envaudit CI integration guide for details.