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

相关推荐
无限进步_22 分钟前
【数据结构&C语言】对称二叉树的递归之美:镜像世界的探索
c语言·开发语言·数据结构·c++·算法·github·visual studio
CoderJia程序员甲1 小时前
GitHub 热榜项目 - 日榜(2026-1-7)
人工智能·ai·大模型·github·ai教程
逛逛GitHub1 小时前
GitHub 上 2300 点赞的搜索 Agent,有点惊艳啊。
github
詹某某34112 小时前
国密内网IP证书申请指南
github·ssl
提笔忘字的帝国2 小时前
【2026最新收集】github国内镜像站,高速访问
github
朱昆鹏5 小时前
IDEA Claude Code or Codex GUI 插件【开源自荐】
前端·后端·github
ONLYOFFICE6 小时前
入门指南:远程运行 ONLYOFFICE 协作空间 MCP 服务器
运维·服务器·github·onlyoffice
自己的九又四分之三站台6 小时前
Halo自建站博客介绍
github
散峰而望7 小时前
【算法竞赛】顺序表和vector
c语言·开发语言·数据结构·c++·人工智能·算法·github
MC皮蛋侠客7 小时前
部署 Sphinx 文档到 GitHub Pages 详细指南
github·全文检索·sphinx