This repository has been archived by the owner on Dec 4, 2022. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
使用 Netlify 配置自动部署
使用上述的 Docker 部署存在以下问题
基于上述问题,我们另一种部署方案是使用
Netlify
如何配置
fork
这个仓库,然后在 Netlify 选择右上角的New site from git
,确认之后,Site settings -> Build & Deploy -> Environment
中添加ENV_URL
环境变量,值为配置文件的存放地点推荐使用
gist
,但值需要Raw
形式比如你的
Github
名是coderming
gist id
是123456789
那么
ENV_URL
的值为构建脚本将读取这个配置文件并且将内容写入
index.js
注意
如果
index.js
已存在于src/config
,那么 脚本 不会 覆盖你的文件,这也就意味着你存放在url
上的内容不会生效netlify
会读取netlify.toml
文件,然后帮你构建发布。最后你会得到一个集成了CDN,letencrypt 的新网站。
当你在
gist
上更新了配置文件时,你需要去netlify
手动触发构建(Deploys -> Trigger Deploy)
。尽情探索
netlify
的特性吧!你还可以绑定自己的域名,比如绑定
example.org
域名你需要为
example.org
添加 泛解析@
的cname
,值为netlify
为你生成的网站的域名大体下面的形式