Deploying easily using Laravel Envoy

I perpetually update my website, and it became a hassle for me during deployment time. I had to open my iTerm, enter my server using SSH, and then pull the updates from Git.

Thankfully, there's a quick way to streamline this process through the Laravel ecosystem using Envoy.

To begin, install the package:

composer require laravel/envoy --dev

Then, create Envoy.blade.php in the root folder and add your deployment script. Here's a sample of my deployment script:

@servers(['web' => ['[email protected]']])

@story('deploy')
    update-code
@endstory

@task('update-code')
    cd /home/ploi/heymeow.dev
    git pull origin main
@endtask

Now, I can deploy using the Envoy script from my VSCode terminal:

php vendor/bin/envoy run deploy

Additionally, I can create an Artisan command script for easy recall. It's a simple addition, but it greatly improves my development experience.