Skip to content

Commit

Permalink
Merge pull request #8 from unexpectedjs/ssimonsen/use-gh-pages
Browse files Browse the repository at this point in the history
Use gh pages (Major)
  • Loading branch information
sunesimonsen committed Oct 30, 2018
2 parents 124cf99 + 5fd784f commit 328892b
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 34 deletions.
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
save-exact=true
package-lock=false
30 changes: 30 additions & 0 deletions bin/deploy-site
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env node
const ghPages = require('gh-pages');
const path = require('path');
const fs = require('fs');
const childProcess = require('child_process');

const packageJson = path.join(process.cwd(), 'package.json');

if (!fs.existsSync(packageJson)) {
console.error('Please run in the root directory of the package');
process.exit(1);
}

const scripts = require(packageJson).scripts

if (!scripts || !scripts['generate-site']) {
console.error('Please setup a generate-site script in your package.json');
process.exit(1);
}

childProcess.execSync('npm run generate-site')

ghPages.publish('site-build', function (err) {
if (err) {
console.error(err);
process.exit(1);
} else {
console.log('Published site');
}
});
34 changes: 0 additions & 34 deletions bin/deploy-site.sh

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"autoprefixer": "6.7.7",
"debug": "4.1.0",
"ejs": "2.5.6",
"gh-pages": "2.0.1",
"glob": "7.1.1",
"lodash": "4.17.11",
"metalsmith": "1.7.0",
Expand Down

0 comments on commit 328892b

Please sign in to comment.