Skip to content

Commit

Permalink
Fixing gh-pages task
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrowd committed Aug 27, 2016
1 parent 3e67f25 commit 5da8b4d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 21 deletions.
37 changes: 21 additions & 16 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,46 +20,51 @@ gulp.task('test', function() {
});

gulp.task('scripts', function() {
browserifyTask({
return browserifyTask({
environment: 'development'
}).vendor();
})

gulp.task('scripts:production', function() {
return browserifyTask({
environment: 'production'
}).vendor();
})

gulp.task('styles', function() {
cssTask({
return cssTask({
environment: 'development'
});
})

gulp.task('styles:production', function() {
return cssTask({
environment: 'production'
});
})

gulp.task('styles:package', function() {
cssTask({
return cssTask({
environment: 'package'
});
})

gulp.task('copy', function() {
copyTask({
return copyTask({
environment: 'development'
});
})

gulp.task('deploy', ['test'], function() {
browserifyTask({
environment: 'production'
})
.vendor();

cssTask({
gulp.task('copy:production', function() {
return copyTask({
environment: 'production'
});
})

copyTask({
environment: 'production'
});
});
gulp.task('prepublish', ['test', 'scripts:production', 'styles:production', 'copy:production'])

gulp.task('publish', function(done) {
ghPagesTask(done);
return ghPagesTask(done);
})

// Development workflow
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"build": "babel ./src -d lib --ignore '__tests__' && gulp styles:package",
"prepublish-to-npm": "git pull && npm run build && git commit -am 'Prepare for publishing'",
"publish-to-npm": "(git pull origin master && npm version patch && git push origin master && git checkout release && git merge master && git push origin release && git checkout master && npm publish && git push --tags)",
"prepublish-to-gh-pages": "node --harmony ./node_modules/gulp/bin/gulp prepublish",
"publish-to-gh-pages": "node --harmony ./node_modules/gulp/bin/gulp publish"
},
"repository": {
Expand Down
11 changes: 6 additions & 5 deletions tasks/gh-pages.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
var gulp = require('gulp');
var path = require('path');
var ghPages = require('gh-pages');
var configs = require('./configs');

module.exports = function(done) {
var origin = configs.paths['production'];

return ghPages.publish(origin, function () {
console.log(arguments);
return ghPages.publish(path.join(__dirname, '../dist'), function (err) {
if (err) {
console.error('Failed to publish', err);
} else {
console.info('Published to gh-pages');
}
done();
});
};
Expand Down

0 comments on commit 5da8b4d

Please sign in to comment.