Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
Simple gulp-rsync deploy
server {
listen 80;
root /sites/SOME-SITE-ROOT-DIRECTORY/staging0;
index index.html index.htm;
location / {
try_files $uri $uri/ /index.html /index.htm;
location ~* .(jpg|jpeg|png|gif|ico|css|js|svg)$ {
expires 1m;
var argv = require('yargs')
.options('d', {
alias: 'dest',
default: 'staging0'
.usage('Usage: $0 -d <staging[0-3]|live>')
gulp.task('deploy', ['build'], function() {
var dest = '/sites/SOME-SITE-ROOT-DIRECTOY/' + argv.d;
console.log('Deploy Destination: "' + dest + '"');
return gulp.src('dist/**')
root: 'dist',
hostname: '',
destination: dest,
user: 'user',
incremental: true,
progress: true,
compress: true,
recursive: true
Copy link

drewlustro commented Dec 13, 2014

Deploy to staging0
gulp deploy

Deploy to target (such as live)
gulp deploy -d live

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