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

相关推荐
Hommy881 小时前
【开源剪映小助手】图片信息生成接口
开源·github·视频剪辑自动化·剪映api
甄心爱学习1 小时前
【项目实训】法律文书智能摘要系统5
python·github
前端点线面3 小时前
GitHub 5月热点:Claude Code生态大爆发
github
DogDaoDao4 小时前
【GitHub】NousResearch/Hermes-Agent 深度技术解析:自我进化的AI Agent新范式
人工智能·深度学习·程序员·大模型·github·ai编程·ai agent
laoli_coding5 小时前
如何将GitCode仓库的提交同步到 GitHub
github·gitcode
拙慕JULY6 小时前
GitHub Copilot 在 Vue.js 开发中的使用
vue.js·github·copilot
zander2586 小时前
如何使用github进行团队开发项目
github·团队开发
ReSearch1 天前
sfsEdgeStore:边缘计算时代的轻量级数据存储解决方案
数据库·后端·github
irpywp1 天前
平台禁下载、格式不兼容、剪辑太麻烦,Media Downloader:mac 原生媒体下载工具,一站式解决视频下载、转码、裁剪、管理难题
macos·开源·github·音视频·媒体
Harvy_没救了1 天前
【github 爆款】隐匿与通行:CloakBrowser 项目深度洞察报告
github