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

相关推荐
u***j3241 天前
GitHub上10个优秀的微服务开源项目
微服务·开源·github
CozyOct11 天前
⚡️2025-11-19GitHub日榜Top5|30秒部署热点助手
github
Zzz 小生1 天前
Github-Go语言AI智能体开发套件:构建下一代智能代理的利器
人工智能·golang·github
正经教主1 天前
【Git】Git05-03:Github身份验证方式PAT和SSH
git·github
逛逛GitHub1 天前
推荐 3 个 AI 智能体 GitHub 项目,太绝了啊。
github
Empty_7771 天前
Ansible变量
服务器·github·ansible
CoderJia程序员甲2 天前
GitHub 热榜项目 - 日榜(2025-11-15)
ai·开源·大模型·github·ai教程
rainboy2 天前
Flutter :自己动手,封装一个小巧精致的气泡弹窗库
前端·flutter·github
Ace_31750887762 天前
拼多多商品详情接口深度解析:从加密参数破解到数据全量获取
前端·数据库·github
CLTHREE2 天前
GitHub项目协作完整指南:从Fork到本地开发
github