Skip to content

Commit

Permalink
faster GitHub Pages deploys (fixes aframevr#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
cvan committed Nov 10, 2015
1 parent 40cb64e commit 7adbd38
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.cache
.DS_Store
build
gh-pages/
Expand Down
13 changes: 12 additions & 1 deletion scripts/gh-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,19 @@ repo.ghPagesUrl = 'https://' + repo.username + '.github.io/' + repo.name + '/';

console.log('Publishing to', repo.url);

ghpages.clean(); // Wipe out the checkout from scratch every time in case we change repos.
function getCacheDir (repoUsername, repoName) {
repoUsername = (repoUsername || '').toLowerCase().trim();
repoName = (repoName || '').toLowerCase().trim();
var pathAbsolute = path.resolve(
__dirname,
'..',
'.cache', 'gh-pages', repoUsername, repoName
);
return path.relative(process.cwd(), pathAbsolute);
}

ghpages.publish(path.join(process.cwd(), 'gh-pages'), {
clone: getCacheDir(repo.username, repo.name),
repo: repo.url,
dotfiles: true,
logger: function (message) {
Expand Down

0 comments on commit 7adbd38

Please sign in to comment.