Skip to content

Instantly share code, notes, and snippets.

@catalinmiron
Last active August 29, 2015 14:28
Show Gist options
  • Save catalinmiron/129543916b57fbcc2d8f to your computer and use it in GitHub Desktop.
Save catalinmiron/129543916b57fbcc2d8f to your computer and use it in GitHub Desktop.
git push gh-pages

Run npm install git-push --save-dev;

Create tools/deploy.js file with approximately the following content:

import push from 'git-push';

const remote = {
  name: 'production',
  url: 'http://github.com/user/test.example.com',
  branch: 'gh-pages'
};

export default async () => {
  await build();
  await new Promise(resolve => push('./build', remote, resolve));
});

Add this script to package.json/scripts. Then you can deploy your app with a single command:

$ npm run deploy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment