mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Merge commit '5cb4e46cfa65bddae8ac5344540e3dd1e4c266b2'
This commit is contained in:
commit
461b0e066f
1 changed files with 9 additions and 8 deletions
|
@ -67,30 +67,31 @@ You're almost done. In order to automate next steps create a `deploy.sh` script.
|
|||
The following are the contents of the `deploy.sh` script:
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
echo -e "\033[0;32mDeploying updates to GitHub...\033[0m"
|
||||
# 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 [ $# -eq 1 ]
|
||||
then msg="$1"
|
||||
msg="rebuilding site $(date)"
|
||||
if [ -n "$*" ]; then
|
||||
msg="$*"
|
||||
fi
|
||||
git commit -m "$msg"
|
||||
|
||||
# Push source and build repos.
|
||||
git push origin master
|
||||
|
||||
# Come Back up to the Project Root
|
||||
cd ..
|
||||
```
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue