<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>GitHub Actions on 晓若寒轻</title><link>https://blog.chunxiao.site/tags/github-actions/</link><description>Recent content in GitHub Actions on 晓若寒轻</description><generator>Hugo -- 0.145.0</generator><language>zh-CN</language><lastBuildDate>Mon, 20 Apr 2026 22:00:00 +0800</lastBuildDate><atom:link href="https://blog.chunxiao.site/tags/github-actions/index.xml" rel="self" type="application/rss+xml"/><item><title>告别自建CI，博客改用GitHub Actions自动化部署</title><link>https://blog.chunxiao.site/posts/github-actions-test/</link><pubDate>Mon, 20 Apr 2026 22:00:00 +0800</pubDate><guid>https://blog.chunxiao.site/posts/github-actions-test/</guid><description>&lt;h2 id="背景">背景&lt;/h2>
&lt;p>之前这个博客的自动化部署一直是用自建 Drone CI 来跑的，相关文章可以翻翻：&lt;a href="https://blog.chunxiao.site/posts/blog-all-proces/">Blog All Process&lt;/a> 和 &lt;a href="https://blog.chunxiao.site/posts/drone-java/">Drone自动化部署Java应用&lt;/a>。&lt;/p>
&lt;p>用了两三年，功能上没问题，push 代码后自动构建部署一条龙。但最近越来越觉得维护这套东西的成本太高了：&lt;/p>
&lt;ol>
&lt;li>&lt;strong>需要一台服务器专门跑 Drone&lt;/strong>——drone-server + drone-runner-docker 两个容器，还得配 NGINX 反代、HTTPS 证书&lt;/li>
&lt;li>&lt;strong>GitHub OAuth 应用要维护&lt;/strong>——Drone 登录依赖 GitHub OAuth，得在 GitHub 上建 OAuth App，配回调地址&lt;/li>
&lt;li>&lt;strong>服务器迁移就全得重来&lt;/strong>——之前从宝塔换到 1Panel，Drone 的 docker socket 映射、目录映射全部得重新搞&lt;/li>
&lt;li>&lt;strong>资源占用不划算&lt;/strong>——就为了跑个博客构建，长期跑两个容器，内存白白占着&lt;/li>
&lt;/ol>
&lt;p>说白了，就我一个用户，建一个博客项目，为了这点需求长期维护一套 CI 系统，性价比太低了。&lt;/p>
&lt;p>于是就想，能不能把这套东西干掉，找个现成的、不用自己维护的方案。&lt;/p>
&lt;h2 id="方案选择">方案选择&lt;/h2>
&lt;p>目前主流的 CI 服务就这几个：&lt;/p>
&lt;ol>
&lt;li>&lt;strong>GitHub Actions&lt;/strong>——GitHub 自带的，免费额度够用，仓库就在 GitHub 上，天然集成&lt;/li>
&lt;li>&lt;strong>GitLab CI&lt;/strong>——如果项目放 GitLab 上可以用，但我项目已经在 GitHub 了&lt;/li>
&lt;li>&lt;strong>Jenkins&lt;/strong>——更重了，跟 Drone 一个性质，需要自己维护服务器&lt;/li>
&lt;li>&lt;strong>Drone Cloud&lt;/strong>——官方托管版，但免费额度有限&lt;/li>
&lt;/ol>
&lt;p>没怎么犹豫就选了 GitHub Actions，原因很简单：&lt;/p>
&lt;ul>
&lt;li>仓库本身就在 GitHub 上，push 就触发，零延迟&lt;/li>
&lt;li>免费额度：每月 2000 分钟，博客构建一次不到 2 分钟，根本用不完&lt;/li>
&lt;li>不用维护任何服务器，GitHub 帮你跑&lt;/li>
&lt;li>配置就是一个 &lt;code>.yml&lt;/code> 文件，放项目里就行&lt;/li>
&lt;/ul>
&lt;h2 id="之前的部署流程">之前的部署流程&lt;/h2>
&lt;p>先回顾一下之前 Drone 的流程长什么样：&lt;/p></description></item></channel></rss>