github pages 的 workflow 突然运行失败

问题:

使用 GitHub pages 搭建的博客网页突然不能运行工作流了,提示:

sh 复制代码
The current runner (ubuntu-24.04-x64) was detected as self-hosted because the platform does not match a GitHub-hosted runner image (or that image is deprecated and no longer supported).
In such a case, you should install Ruby in the $RUNNER_TOOL_CACHE yourself, for example using https://github.com/rbenv/ruby-build
You can take inspiration from this workflow for more details: https://github.com/ruby/ruby-builder/blob/master/.github/workflows/build.yml
$ ruby-build 3.1.4 /opt/hostedtoolcache/Ruby/3.1.4/x64
Once that completes successfully, mark it as complete with:
$ touch /opt/hostedtoolcache/Ruby/3.1.4/x64.complete
It is your responsibility to ensure installing Ruby like that is not done in parallel.

原因:

在运行失败的 workflow 里可以看到警告:ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636

大概意思就是 ubuntu-latest 将被替换为 ubuntu-24.04 。而如果 jekyll 和 ruby 版本与 ubuntu-24.04 不兼容就会 build 失败。

解决:

.github\workflows 下的 jekyll.yml 文件中的 runs-on 部分修改成如下配置

复制代码
jobs:
  # Build job
  build:
    runs-on: ubuntu-22.04

但是据说 ubuntu-22.04 只会再支持两年了,所以等不支持 ubuntu-22.04 的时候 ruby 和 jekyll 肯定已经可以稳定在 ubuntu-24.04 运行了,说实话我挺喜欢 ubuntu-24.04 的,听说这个发行版 LTS 长达 12 年。

相关推荐
FEF前端团队1 天前
开发知识库 #01:Git 全面操作教程
git·github
栩栩云生1 天前
x-cmd v0.8.15: claw AI 助手升级,连微信、飞书更稳了;free 新增专家模式,直接把底层内存细节喂给你
github·agent·命令行
傻啦嘿哟1 天前
Python 文件批量处理:重命名/备份/同步运维实战指南
linux·数据库·github
淘矿人1 天前
Claude辅助算法设计与优化
人工智能·python·算法·microsoft·github·bug·pygame
逛逛GitHub1 天前
给 10 万 Star 的 Hermes 装个记忆外挂,AI 终于能越用越聪明了。
github
王莎莎-MinerU1 天前
MinerU 生态全接入:LangChain、Dify、RAGFlow、LlamaIndex 六大框架完整集成指南(2026)
计算机视觉·chatgpt·langchain·pdf·github·aigc
神一样的老师1 天前
【兆易创新GD32VW553开发板试用】 BSP 从 GitHub 下载与编译指南
单片机·github·rt-thread
DevilSeagull1 天前
MySQL(1) 安装与配置
java·数据库·git·mysql·http·开源·github
kefon1 天前
从零搭一个 AI Agent:我选了最省钱的方案
开源·github·agent
FreeBuf_1 天前
GitHub评论可触发Claude Code、Gemini CLI和GitHub Copilot的提示注入漏洞
github·copilot