Skip to content

Instantly share code, notes, and snippets.

@alfredbez
Created April 24, 2015 14:02
Show Gist options
  • Save alfredbez/d9178ee844c9d67bd455 to your computer and use it in GitHub Desktop.
Save alfredbez/d9178ee844c9d67bd455 to your computer and use it in GitHub Desktop.
Deploy with git, rsync & gulp
#!/bin/sh
### Are any Sass files canged or added?
if git status -s | grep '^M.\+s[ac]ss$'
then
gulp --cwd path/to/gulpfile css
fi
### Are any JS files canged or added?
if git status -s | grep '^M.\+js$'
then
gulp --cwd path/to/gulpfile js
fi
. ./path/to/upload.sh
#!/bin/bash
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
rsync \
-chavzP \
--stats \
--exclude=node_modules \
--exclude=upload.sh \
--exclude=src \
--exclude=package.json \
--exclude=gulpfile.js \
--exclude=bower.json \
--exclude=config.json \
--exclude=.csscomb.json \
$DIR/ \
ssh-host:/path/to/remote/dir/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment