This is the 14th of my series Introduction to Gulp.js. Today I will write a task to sync the files of my Jekyll site to my webserver.
- Intro and Setup
- Server with BrowserSync and Configuration
- Build, Clean and Jekyll
- Creating CSS with Sass (and Compass)
- Images and Vector Fonts
- Base64 Encoded Images
- Watch for Changes
- Generating CSS Image Sprites
- Production Build, Server and Jekyll
- Deploying the Website with Rsync
- Performance Improvements with WebP and Gzip
Deploying the Website
There are a lot of possibilites to get a website on the server. You may use FTP, SFTP, SCP, SCP2, Rsync or Git. I use Rsync because it’s fast and easy to use.
I write another tasks as entry point:
This will just start the
rsync task. But I could add more tasks, for example a task, which creates a zip archive of the build and copies it to a backup on my harddrive.
$ npm install --save-dev firstname.lastname@example.org
This task will grab all files in my production folder, connect to my server and copy all files recursively to my website root. It will delete old files and just add changes to the server.
This concludes the series Introduction to Gulp.js. Developing and deploying with Gulp.js is fun.
I like the UNIX philosophy of Gulp.js: Having small files, which do one task and connect these to larger workflows. And because I kept my Gulp.js tasks small, pluggable and easily shareable, I was able to add Gulp.js to my second website in less than five minutes.