Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
|
||
directory=_site | ||
branch=gh-pages | ||
build_command() { | ||
bundle exec jekyll build | ||
} | ||
|
||
echo -e "\033[0;32mDeleting old content...\033[0m" | ||
rm -rf $directory | ||
|
||
echo -e "\033[0;32mChecking out $branch....\033[0m" | ||
git worktree add $directory $branch | ||
|
||
echo -e "\033[0;32mGenerating site...\033[0m" | ||
build_command | ||
|
||
echo -e "\033[0;32mDeploying $branch branch...\033[0m" | ||
cd $directory && | ||
git pull origin $branch | ||
git add --all && | ||
git commit -m "Deploy updates" && | ||
git push origin $branch | ||
|
||
echo -e "\033[0;32mCleaning up...\033[0m" | ||
git worktree remove $directory |