mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-28 14:40:43 +03:00
Squashed 'docs/' changes from 540aeddc7..41aae7abb
41aae7abb Better deploy script example git-subtree-dir: docs git-subtree-split: 41aae7abb37d43db3a38e09f2ef674cce2c98ce9
This commit is contained in:
parent
35febb2e2a
commit
5cb4e46cfa
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:
|
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.
|
# Build the project.
|
||||||
hugo # if using a theme, replace with `hugo -t <YOURTHEME>`
|
hugo # if using a theme, replace with `hugo -t <YOURTHEME>`
|
||||||
|
|
||||||
# Go To Public folder
|
# Go To Public folder
|
||||||
cd public
|
cd public
|
||||||
|
|
||||||
# Add changes to git.
|
# Add changes to git.
|
||||||
git add .
|
git add .
|
||||||
|
|
||||||
# Commit changes.
|
# Commit changes.
|
||||||
msg="rebuilding site `date`"
|
msg="rebuilding site $(date)"
|
||||||
if [ $# -eq 1 ]
|
if [ -n "$*" ]; then
|
||||||
then msg="$1"
|
msg="$*"
|
||||||
fi
|
fi
|
||||||
git commit -m "$msg"
|
git commit -m "$msg"
|
||||||
|
|
||||||
# Push source and build repos.
|
# Push source and build repos.
|
||||||
git push origin master
|
git push origin master
|
||||||
|
|
||||||
# Come Back up to the Project Root
|
|
||||||
cd ..
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue