Last active
August 29, 2015 14:12
-
-
Save mrailton/80a0b4b8ef1616550e0a to your computer and use it in GitHub Desktop.
Sculpin publisher to github pages
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
#!/bin/bash | |
# Custom sculpin publishing file | |
# Mark Railton - [email protected] | |
if (( $# != 1 )) | |
then | |
echo "You must enter a commit message as an argument" | |
exit 1 | |
fi | |
sculpin generate --env=prod | |
if [ $? -ne 0 ]; then echo "Could not generate the site"; exit 1; fi | |
# Publish live site to GitHub Pages | |
cd output_prod | |
git add . | |
git commit -am "$1" | |
git push github-pages master | |
# Push entire project to main GitHub repo | |
cd ../ | |
git add . | |
git commit -am "$1" | |
git push origin master | |
if [ $? -ne 0 ]; then echo "Could not publish the site"; exit 1; fi | |
echo ""; | |
echo "Site successfully generated, published to GitHub pages and project pushed to GitHub"; | |
echo ""; | |
exit 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment