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

相关推荐
Soari7 小时前
GitHub 开源项目解析:rk‑llama.cpp —— 基于 llama.cpp 的 Rockchip NPU 加速本地推理引擎
开源·github·llama·llm 推理·npu 本地模型推理·加速 c/c++ 开源项目
Hommy887 小时前
【开源剪映小助手】核心功能特性
开源·github·视频剪辑自动化·剪映api
小仙女喂得猪7 小时前
AI 写 Android 代码老翻车?我把移动端的 Harness 系统开源了
android·github·ai编程
AdCj38 小时前
上下文成本四把刀: 本期 GitHub Trending Daily 精选技术分析版(2026-06-04)
github
鱼羽生生8 小时前
基于NetCorePal Cloud Framework的DDD架构管理系统实践
github
自进化Agent智能体8 小时前
Hermes Skill设计模式:把AI能力变成可复用的工程资产
github
AdCj310 小时前
上下文成本四把刀本期 GitHub Trending Daily 精选 (2026-06-04)
github
pipo11 小时前
从 LIO 到 Nav2:我把 FAST-LIO改造成了机器人能用的底盘里程计
github
Jul1en_12 小时前
【AI】Claude Code 迁移至 Codex 的工作流更新-v2
人工智能·ai·github·ai编程
本地化文档12 小时前
psycopg3-docs-l10n
数据库·python·postgresql·github·gitcode·sphinx