Skip to content

Instantly share code, notes, and snippets.

@mattstauffer
Last active November 10, 2024 20:01
Show Gist options
  • Save mattstauffer/16b79f560e035c5f81fb96005853d0e3 to your computer and use it in GitHub Desktop.
Save mattstauffer/16b79f560e035c5f81fb96005853d0e3 to your computer and use it in GitHub Desktop.

Revisions

  1. mattstauffer revised this gist Aug 2, 2024. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions deploy.sh
    Original file line number Diff line number Diff line change
    @@ -12,8 +12,8 @@ $FORGE_COMPOSER install --no-dev --no-interaction --prefer-dist --optimize-autol
    # Run basic Artisan setup commands
    $FORGE_PHP artisan migrate --force
    $FORGE_PHP artisan config:cache
    # Requires modifying the default API route *or* being on Laravel 8+
    # $FORGE_PHP artisan route:cache
    $FORGE_PHP artisan route:cache

    # Only necessary if using Horizon
    # $FORGE_PHP artisan horizon:terminate

  2. mattstauffer created this gist Aug 2, 2024.
    25 changes: 25 additions & 0 deletions deploy.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    cd $FORGE_SITE_PATH

    # Clean production files
    git reset --hard && git clean -df
    git pull origin $FORGE_SITE_BRANCH

    # Composer install & Restart PHP
    $FORGE_COMPOSER install --no-dev --no-interaction --prefer-dist --optimize-autoloader
    ( flock -w 10 9 || exit 1
    echo 'Restarting FPM...'; sudo -S service $FORGE_PHP_FPM reload ) 9>/tmp/fpmlock

    # Run basic Artisan setup commands
    $FORGE_PHP artisan migrate --force
    $FORGE_PHP artisan config:cache
    # Requires modifying the default API route *or* being on Laravel 8+
    # $FORGE_PHP artisan route:cache
    # Only necessary if using Horizon
    # $FORGE_PHP artisan horizon:terminate

    # Build production assets
    npm ci
    npm run build

    # Re-cache views
    $FORGE_PHP artisan view:cache