Skip to content

Instantly share code, notes, and snippets.

@johnRivs
Last active December 31, 2017 17:27
Show Gist options
  • Save johnRivs/66fe101c35a28c089454 to your computer and use it in GitHub Desktop.
Save johnRivs/66fe101c35a28c089454 to your computer and use it in GitHub Desktop.
Deployment workflow

Step 2

Add this to /home/www/repo/myapp.git/hooks/post-receive:

#!/bin/sh
git --work-tree=/home/www/myapp --git-dir=/home/www/repo/myapp.git checkout -f
# Here you would also add stuff like npm install if you need.
# cd /home/www/myapp
# npm install --only=prod
# composer install --no-dev

Step 3

Add the remote:

git remote add origin ssh://[email protected]/home/www/repo/myapp.git

Make some changes, commit the changes and push them:

git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment