summaryrefslogtreecommitdiffstats
path: root/publish.sh
blob: 9c0be670d36099799e83b6e412a876b04ed467ab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash

rm .hugo_build.lock

# 执行 Hugo 构建和部署
commit_date=$(date +"%Y-%m-%d %H:%M:%S")
cd ~/blog/
hugo --cleanDestinationDir --gc --minify
cd ~/blog/public || exit 1
git add .
git commit -m "auto update: $commit_date"
git push origin main

echo "部署完成!"