Skip to content

Instantly share code, notes, and snippets.

Last active September 28, 2016 02:38
What would you like to do?
Code for deploying ember-cli applications with Gulp.js
Code for deploying ember-cli applications with Gulp.js
"key": "<AWS_KEY>",
"secret": "<AWS_SECRET>",
"bucket": "bucket-name",
"region": "us-east-1"
var app = new EmberApp({
fingerprint: {
prepend: '<bucket-name>/'
var fs = require('fs');
var gulp = require('gulp');
var shell = require('gulp-shell');
var s3 = require('gulp-s3');
var gzip = require('gulp-gzip');
var sftp = require('gulp-sftp');
// Build the project using ember-cli
gulp.task('build', shell.task([
'ember build --environment production'
// Deploy all the assets to Amazon S3
gulp.task('deploy:assets', function() {
var aws = JSON.parse(fs.readFileSync('./aws.json'));
var options = { headers: {'Cache-Control': 'max-age=315360000, no-transform, public'} }
return gulp.src('./dist/**')
.pipe(s3(aws, options));
// Deploy the index.html file to a server of your choice
gulp.task('deploy:index', function() {
return gulp.src('./dist/index.html')
host: '',
user: 'deploy',
password: '<deploy-password>',
remotePath: '/var/www/'
// Combine all these tasks into the deploy task
gulp.task('deploy', ['build', 'deploy:assets', 'deploy:index']);
// Default task will only build ember-cli
gulp.task('default', ['build']);
server {
listen 80;
root /var/www/;
location / {
index index.html;
try_files $uri $uri/ /index.html?/$request_uri;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment