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

相关推荐
桃木山人1 小时前
BigData File Viewer报错
大数据·java-ee·github·bigdata
逸Y 仙X5 小时前
Git常见命令--助力开发
java·大数据·git·java-ee·github·idea
007_rbq6 小时前
XUnity.AutoTranslator-Gemini——调用Google的Gemini API, 实现Unity游戏中日文文本的自动翻译
人工智能·python·游戏·机器学习·unity·github·机器翻译
非 白20 小时前
【后端】gitHub访问速度太慢解决办法
github
dringlestry20 小时前
pycharm将当前项目上传到github
ide·pycharm·github
油泼辣子多加1 天前
2025年02月17日Github流行趋势
github
徐小夕1 天前
H5-Dooring零代码搭建:从开源到商业化的4年蜕变
前端·javascript·github
QQ3596773451 天前
Github开源AI LLM大语言模型WebUI框架推荐
人工智能·开源·github
油泼辣子多加1 天前
2025年02月19日Github流行趋势
github
slomay2 天前
项目汇报PPT转视频制作 | 有字幕和配音版
经验分享·github