Created
April 1, 2020 17:40
-
-
Save Awan/0962f678ff2b396cbd34cf542e56137b to your computer and use it in GitHub Desktop.
A deploy script to push your changes to github.
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/sh | |
coded_by=' | |
In the name of Allah, the most Gracious, the most Merciful. | |
▓▓▓▓▓▓▓▓▓▓ | |
░▓ Author ▓ Abdullah <https://abdullah.today> | |
░▓▓▓▓▓▓▓▓▓▓ | |
░░░░░░░░░░ | |
░█▀▄░█▀▀░█▀█░█░░░█▀█░█░█ | |
░█░█░█▀▀░█▀▀░█░░░█░█░░█░ | |
░▀▀░░▀▀▀░▀░░░▀▀▀░▀▀▀░░▀░ | |
' | |
# If a command fails then the deploy stops | |
set -e | |
printf "\033[0;32mDeploying updates to GitHub...\033[0m\n" | |
# Build the project. | |
hugo # if using a theme, replace with `hugo -t <YOURTHEME>` | |
# Go To Public folder | |
cd public | |
# Add changes to git. | |
git add . | |
# Commit changes. | |
msg="rebuilding site $(date)" | |
if [ -n "$*" ]; then | |
msg="$*" | |
fi | |
git commit -m "$msg" | |
# Push source and build repos. | |
git push origin master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment