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

相关推荐
一苓二肆11 小时前
代码常用工具使用
git·vscode·docker·github·vim
Laughtin12 小时前
命令行上传和更新本地项目到github的步骤
github
周杰伦_Jay14 小时前
【BGE-M3与主流RAG嵌入模型】知识库嵌入模型对比
人工智能·机器学习·eureka·开源·github
旅之灵夫15 小时前
【GitHub项目推荐--Spec Kit:规范驱动开发完全指南】
github
旅之灵夫15 小时前
【GitHub项目推荐--Spec Workflow MCP:规范驱动开发的全栈解决方案】
github
Github掘金计划16 小时前
开发者狂喜!GitHub 官方开源:支持 Copilot/Cursor,规范即代码,27k Star 封神!
java·python·kafka·github·copilot
量子炒饭大师17 小时前
一天一个计算机知识——【编程百度】向上取整
c语言·数据结构·c++·git·github
白里透白的小白17 小时前
复盘 Git+GitHub SSH 配置:从权限报错到免密推送的全流程解决方案
git·ssh·github·版本控制
周杰伦_Jay19 小时前
【Agent智能体】开发流程与开源框架对比(GitHub热门项目分析)
开源·github
CoderJia程序员甲19 小时前
GitHub 热榜项目 - 日榜(2025-12-14)
ai·llm·github