-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgulpfile.js
29 lines (28 loc) · 954 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const gulp = require('gulp');
const shell = require('gulp-shell');
gulp.task(
'deploy',
shell.task(
[
'git checkout -b gh-pages-tmp',
// Remove .gitignore, so it won't be active
'rm .gitignore',
// ignore node modules for temp gh pages branch commit
'echo "node_modules/" >> .gitignore',
// Add all files, including the newly built site files
'git add .',
// Commit all changes for deployment
'git commit -am "Remove gitignore; add built docs"',
// Delete remote (origin) gh-pages branch
'git push origin --delete gh-pages',
// Push the 'public' folder to the upstream Github Pages branch
'git subtree push --prefix public origin gh-pages',
// Switch back to master branch
'git checkout master',
// Cleanup temp GitHub Pages branch
'git branch -D gh-pages-tmp',
// Put .gitignore back in place
'git reset --hard HEAD'
]
)
);