Skip to content

Instantly share code, notes, and snippets.

Avatar

Florin Cristea junkystu

  • Bucharest
View GitHub Profile
@junkystu
junkystu / laravel-forge-deployment-script.sh
Last active Feb 26, 2020
Script for quicker deployment with Laravel and Forge
View laravel-forge-deployment-script.sh
# 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
You can’t perform that action at this time.