Skip to content

Latest commit

 

History

History
56 lines (37 loc) · 1.63 KB

gh-pages.md

File metadata and controls

56 lines (37 loc) · 1.63 KB

Deploying to GitHub Pages

Deploying your app using git subtree allows the use of GitHub Pages. Your gh-pages branch will contain the files from dist.

Steps

Prerequisites

  1. If not already available, install git-subtree.
  2. 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.

$ npm install --save-dev gulp-subtree gulp-clean

2. Create a deploy task

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());
});

3. Remove dist from .gitignore

 node_modules
-dist
 .tmp
 .sass-cache
 bower_components
 test/bower_components

Usage

  1. Run $ gulp deploy.
  2. 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.

References