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

相关推荐
徐同保6 小时前
Arguments: ls-remote --tags --heads git://github.com/adobe-webplatform/eve.git
git·adobe·github
CoderJia程序员甲7 小时前
GitHub 热榜项目 - 日榜(2025-10-27)
ai·开源·大模型·github·ai教程
北塔软件8 小时前
各品牌服务器IPMI配置实战经验分享
服务器·git·github
德莱厄斯9 小时前
没开玩笑,全框架支持的 dialog 组件,支持响应式
前端·javascript·github
逛逛GitHub10 小时前
100+ 热门网站克隆版:这个 3 万星的 GitHub 项目顶啊。
github
阿部多瑞 ABU14 小时前
# AI高精度提示词生成项目——3D-VR 课件—— 最终仓库级 AI 提示词:生成《EduVR Studio》—— 专业级 3D-VR 课件创作平台
gitee·开源·github·aigc·ai编程·1024程序员节
hweiyu0016 小时前
Gradle 与 CI/CD 集成:Jenkins/GitHub Actions 自动化构建配置
ci/cd·github·jenkins·gradle
OpenTiny社区16 小时前
我用3 分钟上手 RankProcessChart 排名进度图!
前端·github
十里八乡有名的后俊生16 小时前
从在线文档崩溃说起-我的前端知识管理系统搭建之路
前端·开源·github
HelloGitHub17 小时前
《HelloGitHub》第 115 期
开源·github