improve deploy script
This commit is contained in:
parent
d772571784
commit
b73b02bd92
|
|
@ -1,2 +1,3 @@
|
|||
node_modules
|
||||
.DS_Store
|
||||
_site
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ `git branch --list gh-pages` ]
|
||||
then
|
||||
git branch -D gh-pages
|
||||
git checkout -b gh-pages
|
||||
else
|
||||
git checkout -b gh-pages
|
||||
fi
|
||||
rm -f .gitignore
|
||||
npm run build
|
||||
git add _site
|
||||
git commit -m 'Update Website'
|
||||
git push upstream `git subtree split --prefix _site gh-pages`:gh-pages -f
|
||||
git checkout -f
|
||||
git checkout master
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
#!/bin/sh
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "Which folder do you want to deploy to GitHub Pages?"
|
||||
exit 1
|
||||
fi
|
||||
git subtree push --prefix $1 origin gh-pages
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
"description": "A list of helpful front-end related questions you can use to interview potential candidates, test yourself or completely ignore.",
|
||||
"scripts": {
|
||||
"build": "eleventy --config=config/eleventy.config.js --pathprefix='Front-end-Developer-Interview-Questions/'",
|
||||
"deploy": "git subtree push --prefix _site git@github.com:h5bp/Front-end-Developer-Interview-Questions.git gh-pages",
|
||||
"deploy": "sh ./config/deploy.sh",
|
||||
"contributors:add": "all-contributors add",
|
||||
"contributors:generate": "all-contributors generate",
|
||||
"start": "eleventy --config=config/eleventy.config.js --serve --port 9090 --quiet"
|
||||
|
|
|
|||
Loading…
Reference in New Issue