Skip to content

Instantly share code, notes, and snippets.

@markshust
markshust / README.md
Last active June 18, 2025 07:21
GitHub Action to deploy Laravel app

Set up GitHub Actions to handle deployments for your Laravel application. This has similar functionality to Laravel Forge without the recurring cost. GitHub Actions can be used to automate your deployment process on every push to your repository.

Prerequisites

  1. Server Access: Ensure you have SSH access to your server where the Laravel app will be deployed.
  2. Secrets: Store sensitive information such as your server's IP address, SSH username, and private SSH key in GitHub Secrets. Go to your GitHub repository, navigate to "Settings" > "Secrets and variables" > "Actions", and add the following secrets:
    • DEPLOY_SERVER_IP: Your server's IP address.
    • DEPLOY_SERVER_USER: Your SSH username.
    • DEPLOY_SERVER_KEY: Your private SSH key. Make sure this key is authorized to access your server (~/.ssh/authorized_keys).
  • DEPLOY_SERVER_DIR: The directory where you'd like to deploy your app, relative to /var/www/. Ex: example.com
@tangar76
tangar76 / help.md
Last active February 5, 2020 20:36
Valet deployment
grep --include=\*.php -rnw 'app/code/' -e "echo "
@nerdo
nerdo / DebouncedJob.php
Last active October 16, 2017 19:27 — forked from cabloo/DebouncedJob.php
Debounced Laravel 5.3 Jobs
<?php
// Based on https://gist.github.com/cabloo/328e39a19afeaed1256f83bd4a0ba4bc
// The maxWait option from the previous revision was removed, but can easily be added back in as feature.
namespace App\Jobs;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\DispatchesJobs;
@cabloo
cabloo / DebouncedJob.php
Last active August 22, 2024 18:09
Debounced Laravel Jobs
<?php
namespace App\Support\Jobs;
use Illuminate\Contracts\Queue\ShouldQueue;
class DebouncedJob implements ShouldQueue
{
use \Illuminate\Foundation\Bus\DispatchesJobs;
use \App\Support\Cache\PrefixedCache;