Last active
December 28, 2016 21:58
-
-
Save darth-veitcher/2db53dd6caed63b4d0edaab235210b9c to your computer and use it in GitHub Desktop.
Ghost build script
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 | |
| site='jamesveitch.com' | |
| branch=$(git branch | awk '/\*/ {print $2}') # get the current branch | |
| buster generate | |
| # Remove static folder but ensure we delete stale files and keep the key | |
| # CNAME and build-site.sh files | |
| rsync -rLvP static/* . --delete-after --remove-source-files --exclude CNAME --exclude build-site.sh | |
| rm -rf static | |
| # Edit the robots.txt (seems to keep localhost) | |
| sed -i '' "s|localhost|$site|g" robots.txt | |
| sed -i '' "s|http:|https:|g" robots.txt | |
| # Now commit | |
| git add . | |
| git commit -m "Update on the website at $(date)" | |
| git push origin $branch # don't use origin master as we might be on another branch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment