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 年。

相关推荐
Sakura_j_h_7 小时前
EasyEDA PCB 快速设计Skills
c++·python·github
wflynn10 小时前
GitHub 今日推荐|Edge0:让大号 MoE 模型在一台 Mac 上流式跑起来
python·开源·github
用户别睡觉12 小时前
五大 RAG 开源项目对比 2026:Dify、RAGFlow、FastGPT、AnythingLLM、LightRAG
github
用户72737441388412 小时前
在 Windows 11 上从零装好 Carapace BIN:一次真实操作记录
github
miofly13 小时前
Claude Sonnet 5自主选药选坐标完成小鼠脑部手术,更强模型拒绝执行
开源·github
塞讯科技13 小时前
13,500 个分支被植入窃密工作流:Gheist 如何用 GitHub 令牌搬走仓库密钥
网络安全·ai·github·软件供应链安全·供应链投毒
阿智的AI开发笔记18 小时前
充了 200 块只跑出 3 条:AI 视频真正贵的地方,是「按次」和「按秒」的区别
github
GitHub实测笔记19 小时前
rtk 本机实测:给 AI Agent 砍掉 90% 的命令行噪音(Linux)
github
小莫46119 小时前
CI 全绿了,测试却可能是假的:GitHub Actions 三个静默失效的坑
github
dreams_dream21 小时前
项目想要推送多个平台仓库的方法
gitee·github