通过配置文件deploy.sh实现一键部署到GitHub
(a)deploy.sh文件放在站点根目录下;
(b)执行方法分两种(windows下):

方法一:站点根目录下,鼠标右键,打开git bash here窗口,执行sh deploy.sh。
方法二:选中deploy.sh文件,鼠标右键属性,更改打开方式,将打开方式选择为git-bash.exe执行文件,以后写新的文章后,双击下脚本文件即可成功推送到github上。
#!/bin/bash

echo -e "\033[0;32mDeploying updates to GitHub...\033[0m"

# Build the project.
hugo # if using a theme, replace by `hugo -t <yourtheme>`

# Go To Public folder
cd public
# Add changes to git.
git add -A

# Commit changes.
msg="rebuilding site `date`"
if [ $# -eq 1 ]
  then msg="$1"
fi
git commit -m "$msg"

# Push source and build repos.
git push origin master

# Come Back
cd ..