Skip to content

Commit

Permalink
Create deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiago Porto committed Jun 23, 2018
1 parent e633a69 commit 1e309ad
Show file tree
Hide file tree
Showing 3 changed files with 278 additions and 353 deletions.
34 changes: 3 additions & 31 deletions gulpfile.js
Expand Up @@ -13,7 +13,6 @@ var buffer = require('vinyl-buffer')
var config = require('./config.json')
var del = require('del')
var fs = require('fs')
var ghPages = require('gulp-gh-pages')
var gulp = require('gulp')
var handlebars = require('gulp-hb')
var Karma = require('karma').Server
Expand All @@ -24,7 +23,7 @@ var sequence = require('run-sequence')
var spritesmith = require('gulp.spritesmith')
var svgSprite = require('gulp-svg-sprite')

// ***************************** Path configs ***************************** //
// ***************************** Path configs ***************************** //

var basePaths = config.basePaths

Expand Down Expand Up @@ -316,7 +315,7 @@ gulp.task('scripts', function () {
.pipe(plugins.rename({suffix: '.min'}))
.pipe(plugins.uglify({preserveComments: 'some'}))
.pipe(gulp.dest(paths.scripts.dest))
.pipe(plugins.notify({message: 'Scripts task complete', onLast: true}))
.pipe(plugins.notify({message: 'Scripts task complete', onLast: true}))

return merge(concatenate, copy)
})
Expand All @@ -341,6 +340,7 @@ gulp.task('copy', function () {
var allFiles = gulp
.src([
basePaths.dest + '**/*',
basePaths.dest + 'service-worker.js',
'!' + paths.styles.dest + '**/*',
'!' + paths.scripts.dest + '**/*',
'!' + basePaths.dest + '**/*.{html,php}'
Expand Down Expand Up @@ -467,34 +467,6 @@ gulp.task('compile', function () {
)
})

gulp.task('gh', function () {
return gulp
.src(basePaths.build + '**/*')
.pipe(ghPages())
})

// Build the project and push the builded folder to gh-pages branch
gulp.task('gh-pages', function () {
env = 'prod'
sequence(
[
'outdatedbrowser',
'handlebars',
'images',
'bitmap-sprite',
'vetor-sprite',
'styles-helpers',
'vendor-scripts'
],
'svg2png',
'svg-inline',
'styles',
'scripts',
'copy',
'gh'
)
})

// Build Project and serve if pass the parameter --serve
gulp.task('build', ['clean'], function () {
env = 'prod'
Expand Down

0 comments on commit 1e309ad

Please sign in to comment.