Skip to content

Instantly share code, notes, and snippets.

@jesgs
Last active December 8, 2017 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesgs/82895dfe36c52de4e3e626a5271445f6 to your computer and use it in GitHub Desktop.
Save jesgs/82895dfe36c52de4e3e626a5271445f6 to your computer and use it in GitHub Desktop.
Git post-receive hook for running npm run production on Laravel installs

Just some git hooks I'm putting together

#!/usr/bin/env bash
set -u
set -e
export GIT_WORK_TREE="/home/jess/psy-dreamer.com"
export NODE_VERSION="8.7.0"
echo "--> Selecting Node version $NODE_VERSION"
. $HOME/.nvm/nvm.sh
nvm use $NODE_VERSION
echo "--> run npm run production..."
cd "$GIT_WORK_TREE"
npm run production
echo "--> run php artisan migrate..."
php artisan migrate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment