<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>部署 - 标签 - 我的博客</title><link>https://hex2rgb.github.io/tags/%E9%83%A8%E7%BD%B2/</link><description>部署 - 标签 - 我的博客</description><generator>Hugo -- gohugo.io</generator><language>zh-CN</language><lastBuildDate>Sun, 26 Apr 2026 07:18:37 +0800</lastBuildDate><atom:link href="https://hex2rgb.github.io/tags/%E9%83%A8%E7%BD%B2/" rel="self" type="application/rss+xml"/><item><title>Hugo 跨仓库部署 GitHub Actions 完整配置</title><link>https://hex2rgb.github.io/posts/github-pages-action-settings/</link><pubDate>Sun, 26 Apr 2026 07:18:37 +0800</pubDate><author>Cyber Zen</author><guid>https://hex2rgb.github.io/posts/github-pages-action-settings/</guid><description><![CDATA[<h1 id="hugo-跨仓库部署-github-actions-完整配置">Hugo 跨仓库部署 GitHub Actions 完整配置</h1>
<h2 id="目录">目录</h2>
<ul>
<li><a href="#%e6%9e%b6%e6%9e%84%e6%a6%82%e8%bf%b0" rel="">架构概述</a></li>
<li><a href="#%e5%b8%b8%e8%a7%81%e5%9d%91%e7%82%b9" rel="">常见坑点</a></li>
<li><a href="#%e9%85%8d%e7%bd%ae%e6%ad%a5%e9%aa%a4" rel="">配置步骤</a></li>
<li><a href="#workflow-%e6%96%87%e4%bb%b6" rel="">Workflow 文件</a></li>
<li><a href="#%e6%95%85%e9%9a%9c%e6%8e%92%e6%9f%a5" rel="">故障排查</a></li>
</ul>
<hr>
<h2 id="架构概述">架构概述</h2>
<h3 id="部署架构">部署架构</h3>
<ul>
<li><strong>源码仓库 A</strong>：存放 Hugo 博客源码、主题、配置文件</li>
<li><strong>静态仓库 B</strong>（如 <code>hex2rgb.github.io</code>）：存放打包后的静态页面</li>
</ul>
<h3 id="核心流程">核心流程</h3>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="复制到剪贴板"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><pre tabindex="0"><code>SSH 密钥对（本地生成）
    ↓
公钥 → 部署到【静态仓库 B】Deploy Keys
文章底部-如图【1】
私钥 → 加密存入【源码仓库 A】GitHub Secrets
文章底部-如图【2】
    ↓
Actions 执行：安装 Hugo → 打包源码 → 生成 public → 用私钥推送</code></pre></div>
<hr>
<h2 id="常见坑点">常见坑点</h2>
<h3 id="job-隔离问题">Job 隔离问题</h3>
<p>不同 job 环境完全隔离，执行完毕立即销毁。如果把 build 和 deploy 分为两个 job，打包生成的 public 目录会丢失。</p>]]></description></item></channel></rss>