type
status
date
slug
summary
category
tags
password
icon
- Select repository
- Set up builds and deployments
- Deploy site
Set up builds and deployments
Configure automatic builds and deployments for
Project name notionnext
Production branch main
Pushes to this branch automatically trigger deployments to the Production environment. Pushes to all other branches will trigger deployments within the Preview environment.


- 因为
cf-support
才支持部署到`Cloudflare`, 生产分支需要选择cf-support
分支
- 框架预设选项选择Next.js, 只需要填写正确构建命令即可
构建命令:
npm run export
构建输出目录:
out
- 环境变量设置, 需要设置
NOTION_PAGE_ID={你的Notion Page ID}
这个填你自己的Notion PageID, 如果不清楚, 则去看文档, 这里不赘述NODE_VERSION=16
设置构建时使用NODE版本VERCEL_ENV=production
这个环境变量决定是否把文章静态渲染出来, 如果没有则部署完无法查看文章内容, 会显示博客文章404An unknown error occurred. Please try again later.
An unknown error occured. Contact your account team or Cloudflare support: https://cfl.re/3WgEyrH. (Code: 8000000)

2023-03-22T16:18:48.147546Z Cloning repository...
2023-03-22T16:18:49.125043Z From https://github.com/zoozlezhou/NotionNext
2023-03-22T16:18:49.125665Z * branch edbe3916ab5326384fb220f4261621ae8f5d7737 -> FETCH_HEAD
2023-03-22T16:18:49.125862Z
2023-03-22T16:18:49.304439Z HEAD is now at edbe391 Update blog.config.js
2023-03-22T16:18:49.305030Z
2023-03-22T16:18:49.467480Z
2023-03-22T16:18:49.494761Z Success: Finished cloning repository files
2023-03-22T16:18:50.222876Z Installing dependencies
2023-03-22T16:18:50.234336Z Python version set to 2.7
2023-03-22T16:18:53.692346Z Downloading and installing node v16.19.1...
2023-03-22T16:18:54.133615Z Downloading https://nodejs.org/dist/v16.19.1/node-v16.19.1-linux-x64.tar.xz...
2023-03-22T16:18:54.570295Z Computing checksum with sha256sum
2023-03-22T16:18:54.701116Z Checksums matched!
2023-03-22T16:18:59.118006Z Now using node v16.19.1 (npm v8.19.3)
2023-03-22T16:18:59.503631Z Started restoring cached build plugins
2023-03-22T16:18:59.517891Z Finished restoring cached build plugins
2023-03-22T16:19:00.034336Z Attempting ruby version 2.7.1, read from environment
2023-03-22T16:19:03.855178Z Using ruby version 2.7.1
2023-03-22T16:19:04.232529Z Using PHP version 5.6
2023-03-22T16:19:04.405180Z 5.2 is already installed.
2023-03-22T16:19:04.436370Z Using Swift version 5.2
2023-03-22T16:19:04.437078Z Started restoring cached node modules
2023-03-22T16:19:04.455327Z Finished restoring cached node modules
2023-03-22T16:19:04.980369Z Installing NPM modules using NPM version 8.19.3
2023-03-22T16:19:05.413080Z npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
2023-03-22T16:19:05.413447Z npm WARN config location in the cache, and they are managed by
2023-03-22T16:19:05.413628Z npm WARN config
cacache
.
2023-03-22T16:19:05.835799Z npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
2023-03-22T16:19:05.836259Z npm WARN config location in the cache, and they are managed by
2023-03-22T16:19:05.836421Z npm WARN config cacache
.
2023-03-22T16:19:08.492647Z npm ERR! code ERESOLVE已知问题
- 因为没解决`react-messenger-customer-chat`依赖无法正常安装的问题, 所以删掉了该依赖和相关的组件(
FacebookMessenger
), 因此部署后的博客将不支持这一扩展. 因为我不使用Facebook, 所以这一修改对我没影响.
- 部署在Cloudflare, 因为是纯静态的, 导致站内的搜索功能不可用, 会一直404, 这个应该可以解决, 有空研究下.
- Cloudflare Page的在大陆的可访问性未知, 可能存在无法连接或者加载速度慢的问题
参考:
Loading...