Skip to content

Commit

Permalink
Merge pull request #29 from Granze/deploy
Browse files Browse the repository at this point in the history
Gulp deploy task
  • Loading branch information
Granze committed Dec 26, 2015
2 parents b0526a6 + 7f49bdd commit ffcf073
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -2,3 +2,4 @@ node_modules
.tmp
.idea
dist
.publish
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -37,6 +37,10 @@ __When you are done, create a production ready version of the JS bundle:__

`npm run build`

__Deploy on Github pages with one command:__

`npm run deploy`

## What's new in v2.0:

- React Router integration
Expand Down
9 changes: 8 additions & 1 deletion gulpfile.babel.js
Expand Up @@ -20,6 +20,7 @@ import htmlReplace from 'gulp-html-replace';
import imagemin from 'gulp-imagemin';
import pngquant from 'imagemin-pngquant';
import runSequence from 'run-sequence';
import ghPages from 'gulp-gh-pages';

const paths = {
bundle: 'app.js',
Expand All @@ -29,7 +30,8 @@ const paths = {
srcLint: ['src/**/*.js', 'test/**/*.js'],
dist: 'dist',
distJs: 'dist/js',
distImg: 'dist/images'
distImg: 'dist/images',
distDeploy: './dist/**/*'
};

const customOpts = {
Expand Down Expand Up @@ -118,6 +120,11 @@ gulp.task('watchTask', () => {
gulp.watch(paths.srcJsx, ['lint']);
});

gulp.task('deploy', function() {
return gulp.src(paths.distDeploy)
.pipe(ghPages());
});

gulp.task('watch', cb => {
runSequence('clean', ['browserSync', 'watchTask', 'watchify', 'styles', 'lint', 'images'], cb);
});
Expand Down
10 changes: 6 additions & 4 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "react-starterify",
"version": "2.1.3",
"version": "2.1.4",
"description": "React JS application skeleton using Browserify and other awesome tools",
"main": "app.js",
"repository": {
Expand All @@ -23,7 +23,8 @@
"scripts": {
"test": "mocha --reporter nyan --compilers js:babel-core/register --recursive",
"watch": "gulp watch",
"build": "gulp build"
"build": "gulp build",
"deploy": "gulp deploy"
},
"author": "Maurizio Mangione",
"license": "MIT",
Expand All @@ -32,10 +33,10 @@
},
"homepage": "https://github.com/Granze/react-starterify",
"dependencies": {
"history": "~1.13.x",
"history": "^1.17.0",
"react": "^0.14.0",
"react-dom": "^0.14.0",
"react-router": "^1.0.2"
"react-router": "^1.0.3"
},
"devDependencies": {
"autoprefixer": "^6.0.0",
Expand All @@ -52,6 +53,7 @@
"eslint-plugin-react": "^3.3.2",
"gulp": "^3.9.0",
"gulp-eslint": "^1.0.0",
"gulp-gh-pages": "^0.5.4",
"gulp-html-replace": "^1.5.1",
"gulp-imagemin": "^2.4.0",
"gulp-notify": "^2.2.0",
Expand Down

0 comments on commit ffcf073

Please sign in to comment.