惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

I
InfoQ
F
Full Disclosure
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Threatpost
AWS News Blog
AWS News Blog
The GitHub Blog
The GitHub Blog
G
GRAHAM CLULEY
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Palo Alto Networks Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Latest news
Latest news
S
SegmentFault 最新的问题
C
Cisco Blogs
T
Tenable Blog
爱范儿
爱范儿
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
Securelist
S
Schneier on Security
博客园 - 三生石上(FineUI控件)
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Microsoft Azure Blog
Microsoft Azure Blog
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
T
Threat Research - Cisco Blogs
IT之家
IT之家
博客园_首页
C
Cyber Attacks, Cyber Crime and Cyber Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
K
Kaspersky official blog
aimingoo的专栏
aimingoo的专栏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
P
Privacy International News Feed
腾讯CDC
A
About on SuperTechFans
Y
Y Combinator Blog
月光博客
月光博客
C
Check Point Blog
Last Week in AI
Last Week in AI
Know Your Adversary
Know Your Adversary
Hugging Face - Blog
Hugging Face - Blog
U
Unit 42
WordPress大学
WordPress大学
T
The Exploit Database - CXSecurity.com
H
Hacker News: Front Page
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
Vulnerabilities – Threatpost
Cyberwarzone
Cyberwarzone
L
LINUX DO - 热门话题
MongoDB | Blog
MongoDB | Blog
T
Troy Hunt's Blog

绘星里

绘星里 | 2026-06小记 绘星里 | 2026-05小记 绘星里 | 2026-04小记 绘星里 | emaction,但适配pjax(附新版教程) 绘星里 | 2026-03小记 绘星里 | 2026-02小记 绘星里 | 2026-01小记 绘星里 | 2025小结 绘星里 | 2025-12小记 绘星里 | 2025的最后几天,主题再次重写 绘星里 | 一个追梦者的“堕落”
绘星里 | 将Hugo博客通过CNB部署到Edgeone Pages和Vercel
王九弦SZ·Ninty · 2026-01-11 · via 绘星里

2026年1月11日 站点折腾 站点折腾 154 字 1 分钟

考完春季高考之后,终究还是没忍住 CNBEdgeone Pages 的诱惑

到家立刻就给博客源码放到CNB上面来了当然这没有开源
同时在 枋柚梓的文章 那边了个将博客仓库同步到Github的配置

但是 Edgeone Pages 没有可以配置Hugo模版的地方
而且cnb的云原生构建和和github action不太一样
云原生那个是用的Docker镜像

我选取的镜像是hugomods/hugo:node-git,因为这个镜像带 Git 和 node
(用 Node 的原因是我配置了 gulp 来压缩站点的静态资源)

配置文件(Vercel):

# 定义云构建
main:
  push:
    - name: 上传到Vercel
      imports: 
        - https://cnb.cool/SinzMise/szn-cnb-keys/-/blob/main/blog-push.yml
      docker:
        image: hugomods/hugo:node-git
        volumes:
          - /root/.npm
          - ./node_modules
      stages:
        - name: 安装依赖
          script: |
            npm install
            npm install -g gulp-cli vercel
        - name: 构建博客 + 上传到Vercel
          script: |
            npm run build
            npm run compress
            cd public
            vercel deploy --prod --token $VERCEL_TOKEN

配置文件(Edgeone Pages):

# 定义云构建
main:
  push:
    - name: 上传到Edgeone
      imports: 
        - https://cnb.cool/SinzMise/szn-cnb-keys/-/blob/main/blog-push.yml
      docker:
        image: hugomods/hugo:node-git
        volumes:
          - /root/.npm
          - ./node_modules
      stages:
        - name: 安装依赖
          script: |
            npm install
            npm install -g gulp-cli edgeone
        - name: 构建博客 + 上传到Edgeone
          script: |
            npm run build
            npm run compress
            edgeone pages deploy ./public -n cenablog -t $EDGEONE_TOKEN

关于npm run buildnpm run compress的定义如下:

{
  "scripts": {
    "build": "node link.js && hugo --gc", // 友链朋友圈json的生成和Hugo的构建
    "compress": "gulp" // 静态资源压缩
  },
}

本文作者: 王九弦SZ·Ninty

版权声明: 转载请注明原文出处及本声明。本文采用 BY-NC-SA 许可协议进行许可。

网络回响

加载中...

发送回应

如果您在其他地方写过关于这篇文章的文章,可以在这里发送 Webmention: