Skip to content

Commit

Permalink
Add gh-pages deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiko Naito committed Feb 14, 2017
1 parent f024830 commit 2bb75ae
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ You will need to upload `build/app.js` to asset service, and update the asset ID
`chronicdata.cdc.gov` repository. If there are CSS changes, copy `build/_app.css` into
`css` directory in `chronicdata.cdc.gov` repository.
### Deploying to gh-pages
Running `npm run deploy` uses [gh-pages][] to deploy contents of `build` directory
to `gh-pages` branch.
[gh-pages]: https://github.com/tschaub/gh-pages
## Known Issues
- HMR will reload the entire page when changes are made to a component.
Expand Down
6 changes: 6 additions & 0 deletions deploy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const ghpages = require('gh-pages');
const path = require('path');

ghpages.publish(path.join(__dirname, 'build'), function(err) {
console.log(err);
});
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"build": "better-npm-run build",
"build:dev": "better-npm-run build:dev",
"start": "better-npm-run start",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"deploy": "node ./deploy.js"
},
"betterScripts": {
"build": {
Expand Down Expand Up @@ -63,6 +64,7 @@
"eslint-plugin-jsx-a11y": "^1.5.3",
"eslint-plugin-react": "^5.2.2",
"extract-text-webpack-plugin": "^1.0.1",
"gh-pages": "^0.12.0",
"html-webpack-plugin": "^2.22.0",
"json-loader": "^0.5.4",
"path": "^0.12.7",
Expand Down

0 comments on commit 2bb75ae

Please sign in to comment.