Skip to content

Instantly share code, notes, and snippets.

View junkystu's full-sized avatar

Florin Cristea junkystu

View GitHub Profile
@junkystu
junkystu / laravel-forge-deployment-script.sh
Last active May 23, 2021 05:18
Script for quicker deployment with Laravel and Forge
# The idea of this deployment script is to create a deploy copy of your website and handle
# Git and Composer updates in there. Aferwards, it just renames that deploy copy to become the
# live website. We then run the database migrations and take the application out of maintenance mode.
# Obviously, you will have to replace all instances of {{ websiteName }} with the name of your website and
# {{ branchName }} with the name of the branch you would like to pull changes from. This is usually the master branch.
# Start by checking for for old deployment folder and remove it if we have one.
if [ -d "/home/forge/{{ websiteName }}-deploy" ]; then
rm -Rf /home/forge/{{ websiteName }}-deploy