Last active
April 13, 2020 19:14
-
-
Save abdus/e5df31cfdf40a0542f1731599936a3a9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Stage and Commit Every Unsaved changes | |
# and push them to master | |
git add . | |
git commit -m 'comitted from deploy script' | |
git push origin master | |
# generate a clean build | |
bundle exec jekyll clean | |
bundle exec jekyll doctor | |
bundle exec jekyll build | |
# create and Checkout to gh-pages | |
git checkout gh-pages | |
# delete everything except _site | |
for dir in *; do | |
[ "$dir" = "_site" ] && continue | |
rm -rf "$dir" | |
done | |
# delete dotfiles | |
for dir in .*; do | |
[ "$dir" = ".git" ] && continue | |
rm -rf "$dir" | |
done | |
# move files from _site to . | |
mv _site/* ./ | |
# Commit everything in gh-pages | |
git add . | |
git commit -m 'Deployed' | |
git push origin gh-pages | |
# check back to master and run `bundle install` | |
git checkout master | |
bundle install | |
echo \n\n\n | |
echo ............................................................... | |
echo ...................... Deployed ...................... | |
echo ............................................................... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment