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

相关推荐
明月_清风7 小时前
GitHub Actions 从入门到实战:一文搞懂 CI/CD 自动化
后端·ci/cd·github
QUOR7 小时前
Zorv AI 终端:基于 proot 沙箱的 Android 终端模拟器架构全解析
github
其实防守也摸鱼7 小时前
ZLibrary 类项目合规避坑指南:从技术实现到法律风险的全景梳理
运维·服务器·数据库·安全·自动化·github·copilot
今天AI了吗9 小时前
AI工作流的自动化趋势:从手动实验到自主Agent的研究范式转变
运维·数据库·人工智能·sql·机器学习·自动化·github
m4Rk_11 小时前
【论文阅读】Agent 记忆机制(53):Experience-Following——为什么错误经验会在记忆中不断传播
论文阅读·人工智能·学习·开源·github
峰向AI1 天前
Superpower 不是最「聪明」的,这个开源项目让模型学会资深工程师的肌肉记忆
github
YuePeng1 天前
卖了几年的 BI 模块突然免费:24 种图表,一条 SQL 一张图
github
dong_junshuai1 天前
每天一个开源项目#82 9.2K星God's Eye View:公开信号3D地球
开源·github
简创AIGC陶先生1 天前
第1章:项目全景与架构总览
github
怕浪猫1 天前
ZCode 周末送额度活动开启:3 亿 Token 免费领取
github