blog/content/posts/no-ssh-deploy.md

32 lines
940 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "没有 SSH 也能维护博客"
date: 2026-07-31
draft: false
tags: ["自动化", "Gitea", "CI/CD"]
---
## 为什么要搞自动发布?
之前维护博客需要 SSH 到服务器手动执行 `hugo build` + 部署。但如果在没有 SSH 插件的环境下(比如只有 HTTP API怎么办
答案是 **Gitea + Webhook 自动化**
```
写文章 → git push → Gitea 收到推送
→ 触发 Webhook
→ 服务器自动 git pull + hugo build + 部署
```
### 这篇文章就是自动发布的
如果你能看到这个页面,说明自动发布链路完全正常——**没有用 SSH纯 HTTPS**。
### 维护方式对比
| 方式 | 需要 SSH | 操作 |
|------|:--:|------|
| 之前 | ✅ | SSH → hugo build → 手动部署 |
| 现在 | ❌ | `git push` 即发布 |
这篇博文从 NAS push 到 GiteaWebhook 自动触发了构建和部署。全程零 SSH。