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
origin
remote.
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'], function () {
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.