improve deploy script

This commit is contained in:
Cezar Augusto 2018-12-03 02:34:27 -02:00
parent d772571784
commit b73b02bd92
4 changed files with 18 additions and 8 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
node_modules
.DS_Store
_site

16
config/deploy.sh Normal file
View File

@ -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

View File

@ -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

View File

@ -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"