From 3f3bc5f5bcfe3ecfe9d33bc66864bdf5f43f1d56 Mon Sep 17 00:00:00 2001 From: Mark Moser Date: Wed, 23 Aug 2017 16:31:57 -0500 Subject: [PATCH] production deploy! --- .gitignore | 1 + Gruntfile.js | 31 ++++++++++++++++++++++++++++--- package.json | 1 + site/partials/analytics.hbs | 18 ++++++++++-------- 4 files changed, 40 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 3b69587..fba233a 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,4 @@ results node_modules dist dest +sftpCache.json diff --git a/Gruntfile.js b/Gruntfile.js index 9ed9f50..2a86398 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -101,6 +101,7 @@ module.exports = function(grunt) { assemble: { options: { + production: false, assets: '<%= config.dest %>/assets', data: '<%= config.source %>/data/*.yml', flatten: true, @@ -109,7 +110,14 @@ module.exports = function(grunt) { partials: '<%= config.source %>/partials/**/*.hbs' }, - build: { + buildDev: { + files: [{'<%= config.dest %>/': ['<%= config.source %>/pages/**/*.hbs']}] + }, + + buildProd: { + options: { + production: true, + }, files: [{'<%= config.dest %>/': ['<%= config.source %>/pages/**/*.hbs']}] } }, @@ -129,7 +137,7 @@ module.exports = function(grunt) { }, assemble: { files: '<%= config.source %>/**/*.hbs', - tasks: ['assemble:build'] + tasks: ['assemble:buildDev'] } }, @@ -155,14 +163,31 @@ module.exports = function(grunt) { } } } + }, + + 'sftp-deploy': { + build: { + auth: { + host: 'markamoser.com', + port: 6791, + authKey: 'workhorse' + }, + cache: 'sftpCache.json', + src: 'dist/', + dest: 'www/markamoser/', + progress: true + } } + }); // Tasks grunt.registerTask('lint', ['sasslint', 'eslint']); - grunt.registerTask('build', ['clean:build', 'copy', 'sass', 'postcss', 'assemble']); + grunt.registerTask('build', ['clean:build', 'copy', 'sass', 'postcss', 'assemble:buildDev']); + grunt.registerTask('buildProd', ['clean:build', 'copy', 'sass', 'postcss', 'assemble:buildProd']); grunt.registerTask('default', ['lint', 'build']); grunt.registerTask('serve', ['lint', 'build', 'browserSync', 'watch']); + grunt.registerTask('deploy', ['buildProd', 'sftp-deploy:build']); }; diff --git a/package.json b/package.json index b25fb0a..437db4e 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "grunt-postcss": "^0.8.0", "grunt-sass": "^2.0.0", "grunt-sass-lint": "^0.2.2", + "grunt-sftp-deploy": "^0.2.5", "load-grunt-tasks": "^3.5.2", "sass-lint": "^1.10.2" }, diff --git a/site/partials/analytics.hbs b/site/partials/analytics.hbs index 21323e6..c42e0ab 100644 --- a/site/partials/analytics.hbs +++ b/site/partials/analytics.hbs @@ -1,9 +1,11 @@ - + ga('create', 'UA-105222939-1', 'auto'); + ga('send', 'pageview'); + +{{/if}}