Deploying your app using git subtree allows the use of GitHub Pages. Your gh-pages branch will contain the files from dist.
- If not already available, install git-subtree.
- Ensure your generated app is in a GitHub-hosted repository that is set as your
originremote.
You can check your remotes with
$ git remote -v. See Adding a remote for more info.
1. Install gulp-subtree
$ npm install --save-dev gulp-subtree
This will run the build task, then push it to the gh-pages branch:
gulp.task('deploy', ['build'], () => {
return gulp.src('dist')
.pipe($.subtree())
.pipe($.clean());
}); node_modules
-dist
.tmp
.sass-cache
bower_components
test/bower_components- Run
$ gulp deploy. - Visit
http://[your-username].github.io/[repo-name].
It might take a couple of minutes for your page to show up the first time you push to gh-pages. In the future, changes will show up instantly.
- See gulp-subtree for details on changing the branch and commit message.
- See GitHub Pages documentation for features such as custom domains.
this is a fork from https://github.com/yeoman/generator-gulp-webapp/blob/master/docs/recipes/gh-pages.md