Skip to main content

Requirements

  • Ghostable CLI installed in your app.
  • A GHOSTABLE_CI_TOKEN (environment-scoped). Store it in your Forge environment, or in your CI/CD secrets if you are deploying automatically.

Deployments

Add Ghostable’s deploy:forge command to your Forge deployment script.
Be sure the GHOSTABLE_CI_TOKEN you are using corresponds with the Ghostable environment you intend to deploy.
Example
cd /home/forge/default

git pull origin $FORGE_SITE_BRANCH
$FORGE_COMPOSER install --no-dev --no-interaction --prefer-dist --optimize-autoloader

# Prevent concurrent php-fpm reloads...
touch /tmp/fpmlock 2>/dev/null || true
( flock -w 10 9 || exit 1
    echo 'Reloading PHP FPM...'; sudo -S service $FORGE_PHP_FPM reload ) 9</tmp/fpmlock

npm ci && npm run build

if [ -f artisan ]; then
    $FORGE_PHP artisan optimize
    $FORGE_PHP artisan migrate --force

    # Deploy Ghostable-managed environment variables
    $FORGE_PHP vendor/bin/ghostable deploy:forge

    $FORGE_PHP artisan config:cache
fi
Ghostable merges its managed variables with those already in Forge. Existing keys are updated in place, new keys are added, and anything unmanaged is left untouched.

Encryption

Environment file encryption works in Forge just like it does in Vapor. Pass the --encrypted flag to deploy:forge, and Ghostable will bundle variables into an encrypted file. Ghostable automatically generates and stores the required LARAVEL_ENV_ENCRYPTION_KEY in your Forge environment so decryption works at runtime.
Deployment Script
$FORGE_PHP vendor/bin/ghostable deploy:forge --encrypted
Benefits:
  • Eliminates the need to commit encrypted .env files into source control.
  • Reduces merge conflicts when working in teams.

FAQS

Yes — Forge rollbacks behave as normal. But note: - Rollbacks affect the code and deployment artifact only. - Ghostable-managed variables are not rolled back automatically.
If you need to roll back variables, perform the rollback in Ghostable as well.
No — Ghostable only pushes the variables it manages. If you remove a variable from Ghostable, it is not automatically removed from Forge.
Manually clean up unused variables in Forge to avoid confusion or security risk.
Ghostable tracks the delivery mode for each variable, but Forge may still have old copies.
When migrating a variable between plain and encrypted, remove the old copy from Forge once you’ve confirmed your app is reading the new value.