update
This commit is contained in:
parent
8a8347d508
commit
187d994e6f
23
README.md
23
README.md
@ -27,12 +27,29 @@
|
||||
git push
|
||||
```
|
||||
|
||||
## 挂载 hugo 和 nginx 前端目录
|
||||
- 下载 [hugo_extended](https://github.com/gohugoio/hugo/releases)
|
||||
- 解压获取可执行二进制文件 hugo
|
||||
- 挂载 hugo 到 gitea 容器中
|
||||
```yaml
|
||||
- type: bind
|
||||
source: ./gitea/hugo
|
||||
target: /usr/bin/hugo
|
||||
```
|
||||
|
||||
- 挂载 nginx 前端目录到 gitea 容器中
|
||||
```yaml
|
||||
- type: bind
|
||||
source: ./nginx/html
|
||||
target: /html
|
||||
```
|
||||
|
||||
## 发布
|
||||
- 配置本仓库的 post-receive 钩子,内容如下
|
||||
```bash
|
||||
set -euo pipefail
|
||||
|
||||
exec &> /var/log/gitea/post-receive.log
|
||||
exec &> /opt/gitea/log/post-receive.log
|
||||
date +'[%F %T] Update www.colben.cn ...'
|
||||
cd /html/www.colben.cn
|
||||
env -i git pull origin master
|
||||
@ -42,9 +59,7 @@
|
||||
- 克隆本仓库的前端目录
|
||||
```bash
|
||||
docker exec -ti gitea /bin/bash # 进入 gitea 容器
|
||||
apk update
|
||||
apk add --no-cache hugo # 安装 hugo
|
||||
chown gitea.www-data /html
|
||||
chown gitea.gitea /html
|
||||
su - gitea
|
||||
cd /html
|
||||
git clone https://git.colben.cn/colben/www.colben.cn.git
|
||||
|
Loading…
x
Reference in New Issue
Block a user