1. 先註冊Vercel.com
2. 然後Fork我的項目 https://github.com/evlon/gitee-pages-build-by-vercel.git
3. Vercel 導入項目,配置環境變量 ,配置修改後記得重新部署。 見附圖1
GITEE_USERNAME=your name
GITEE_PASSWORD=your password
GITEE_REPO=your repo
GITEE_BRANCH=your branch
GITEE_DIRECTORY=/
GITEE_HTTPS=1
GITEE_GIST_TOKEN=tokenstring
GITEE_GIST_ID=gist_id
X_GITEE_TOKEN=gitee web hook token
4.驗證一下, https://your-vercel-domain.vercel.app/api/hello , 如果返回 {"msg":"access not allowd."} 說明程序OK。
5. 登錄Gitee的倉庫,配置web hook . 見圖2. 其中 “Web hook 密碼” == X_GITEE_TOKEN
6.在Gitee上新建一個代碼片段,更新配置項:GITEE_GIST_ID ,並生產私人祕鑰, 更新配置項 GITEE_GIST_TOKEN。 這個可以不用總是每次登錄你的Gitee , 具體參照 https://github.com/evlon/gitee-pages-build
7. 提交一個測試一下吧。
附圖1:
附圖2:
GITEE_BRANCH
Production, Preview, Development
VALUE
•••••••••••••••
Updated 2d ago
X_GITEE_TOKEN
Production, Preview, Development
VALUE
•••••••••••••••
Added 2d ago
GITEE_GIST_ID
Production, Preview, Development
VALUE
•••••••••••••••
Added 2d ago
GITEE_GIST_TOKEN
Production, Preview, Development
VALUE
•••••••••••••••
Added 2d ago
GITEE_HTTPS
Production, Preview, Development
VALUE
•••••••••••••••
Added 2d ago
GITEE_DIRECTORY
Production, Preview, Development
VALUE
•••••••••••••••
Added 2d ago
GITEE_REPO
Production, Preview, Development
VALUE
•••••••••••••••
Added 2d ago
GITEE_PASSWORD
Production, Preview, Development
VALUE
•••••••••••••••
Added 2d ago
GITEE_USERNAME
Production, Preview, Development
VALUE
•••••••••••••••
Added 2d ago