Created
July 18, 2020 11:26
-
-
Save Kavithvajen/93189ed0d7436606c9b562d289d436b9 to your computer and use it in GitHub Desktop.
Z Shell (zsh) script to manage a Hugo site hosted on GitHub Pages. YouTube Link: https://youtu.be/5TrMF_aFa5E
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/zsh | |
vared -p "Enter commit message: " -c message | |
printf "\e[33m\nBuilding project...\e[39m\n" | |
hugo -d ../YOUR_GITHUB_USERNAME.github.io | |
printf "\\e[33m\nPushing to YOUR_GITHUB_USERNAME.github.io repository...\e[39m\n\n" | |
cd ../YOUR_GITHUB_USERNAME.github.io | |
git add . | |
git commit -m "$message" | |
git push origin master | |
printf "\e[32m\nSuccessfully deployed the website!\e[39m" | |
printf "\e[33m\n\nNow pushing latest changes to PERSONAL_REPOSITORY_NAME repository...\e[39m\n\n" | |
cd ../PERSONAL_REPOSITORY_NAME | |
git add . | |
git commit -m "$message" | |
git push origin master | |
printf "\033[0;32m\nSuccessfully pushed changes to the repository!\e[39m\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
do you have a github for this hugo rep?