Skip to content

Instantly share code, notes, and snippets.

@hassansin
Created May 18, 2015 08:41
Show Gist options
  • Save hassansin/9f632c50221aa6ccf726 to your computer and use it in GitHub Desktop.
Save hassansin/9f632c50221aa6ccf726 to your computer and use it in GitHub Desktop.
Deploy Node app with bash
#!/bin/env sh
USER=ubuntu
SERVER=example.com
DESTINATION=/var/www/ics-feed
git archive -o latest.zip HEAD
scp latest.zip $USER@$SERVER:$DESTINATION
ssh $USER@$SERVER " \
mkdir -vp $DESTINATION && cd $DESTINATION \
&& unzip -o latest.zip -d ./ \
&& npm install\
&& sudo PORT=80 pm2 restart bin/www --name app-name\
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment