Skip to content

GitHub Secrets & Variables

Configure these in your GitHub repository: Settings > Secrets and variables > Actions.

Secrets

Secrets are encrypted and not visible after creation.

Required (Both Strategies)

SecretDescriptionExample
SSH_PRIVATE_KEYFull SSH private key content-----BEGIN OPENSSH PRIVATE KEY-----...
SSH_KNOWN_HOSTSKnown hosts entry for the serverOutput of ssh-keyscan -p 65100 host

Optional

SecretDescription
SSH_KEY_PASSPHRASESSH key passphrase, if set

FTP Strategy Only

SecretDescriptionExample
FTP_HOSTFTP server hostnameyour-server.netsons.com
FTP_USERFTP usernameyour-cpanel-user
FTP_PASSFTP passwordyour-cpanel-password
FTP_PORTFTP port21

Custom Env Variables

Any secret-backed env variables configured in netsons-deploy.json must also be added as secrets. For example:

SecretDescription
DB_DATABASEDatabase name
DB_USERNAMEDatabase username
DB_PASSWORDDatabase password

Use php artisan netsons:env list to see all configured secrets.

Notifications (Optional)

SecretDescription
SLACK_WEBHOOK_DEBUGSlack webhook URL for deploy notifications

The secret name is configurable via netsons-deploy.json.

Variables

Variables are visible in plain text. Do not store sensitive data here.

Required (Both Strategies)

VariableDescriptionExample
SSH_HOSTSSH hostnameyour-server.netsons.com
SSH_USERSSH usernameyour-cpanel-user
DEPLOY_PATHDeploy path relative to homepublic_html
APP_ENVApplication environmentproduction
APP_DEBUGDebug modefalse
APP_URLApplication URLhttps://your-domain.com

Optional

VariableDefaultDescription
SSH_PORT65100SSH port

Git Strategy Only

VariableDescriptionExample
GIT_REPORepository URL (SSH format)git@github.com:user/repo.git
GIT_BRANCHBranch to deploymain

Environment-Specific Configuration

Use GitHub Environments to have different values per environment:

  1. Go to Settings > Environments
  2. Create stage and production environments
  3. Add environment-specific variables/secrets to each

This allows the same workflow to deploy to different servers or paths depending on the selected environment.

Getting SSH Values

SSH_PRIVATE_KEY

Terminal window
cat ~/.ssh/id_ed25519

Include everything from -----BEGIN to -----END.

SSH_KNOWN_HOSTS

Terminal window
ssh-keyscan -p 65100 your-server.netsons.com

Copy the full output.