Skip to content

Commit

Permalink
docs: add vercel instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Yidadaa committed Apr 12, 2023
1 parent a15bd3c commit 3ee99ca
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 11 deletions.
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ One-Click to deploy well-designed ChatGPT web UI on Vercel.

## FAQ

[简体中文 > 常见问题](./docs/faq-cn.md) | [English > FAQ](./docs/faq.en.md)
[简体中文 > 常见问题](./docs/faq-cn.md)

[English > FAQ](./docs/faq-en.md)

## Keep Updated

Expand All @@ -86,13 +88,18 @@ If you have deployed your own project with just one click following the steps ab

We recommend that you follow the steps below to re-deploy:

- Delete the original repo;
- Fork this project;
- Go to the Vercel dashboard, delete the original project, then create a new project and select the project you just forked to redeploy;
- Please manually add an environment variable named `OPENAI_API_KEY` and enter your API key as the value during the redeploy process.
- Delete the original repository;
- Use the fork button in the upper right corner of the page to fork this project;
- Choose and deploy in Vercel again, [please see the detailed tutorial](./docs/vercel-en.md#how-to-create-a-new-project).

## Enable Automatic Updates
After forking the project, due to the limitations imposed by Github, you need to manually enable Workflows and Upstream Sync Action on the Actions page of the forked project. Once enabled, automatic updates will be scheduled every hour:

![Automatic Updates](./docs/images/enable-actions.jpg)

This project will be continuously updated, and after forking the project, the upstream code will be automatically synchronized every day without additional operations.
![Enable Automatic Updates](./docs/images/enable-actions-sync.jpg)

### Manually Updating Code
If you want to update instantly, you can check out the [Github documentation](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork) to learn how to synchronize a forked project with upstream code.

You can star or watch this project or follow author to get release notifictions in time.
Expand Down
16 changes: 11 additions & 5 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,18 @@
如果你按照上述步骤一键部署了自己的项目,可能会发现总是提示“存在更新”的问题,这是由于 Vercel 会默认为你创建一个新项目而不是 fork 本项目,这会导致无法正确地检测更新。
推荐你按照下列步骤重新部署:

- 删除掉原先的 repo;
- fork 本项目;
- 前往 vercel 控制台,删除掉原先的 project,然后新建 project,选择你刚刚 fork 出来的项目重新进行部署即可;
- 在重新部署的过程中,请手动添加名为 `OPENAI_API_KEY` 的环境变量,并填入你的 api key 作为值。
- 删除掉原先的仓库;
- 使用页面右上角的 fork 按钮,fork 本项目;
- 在 Vercel 重新选择并部署,[请查看详细教程](./docs/vercel-cn.md#如何新建项目)

本项目会持续更新,当你 Fork 项目之后,默认会每天自动同步上游代码,无需额外操作。
### 打开自动更新
当你 fork 项目之后,由于 Github 的限制,需要手动去你 fork 后的项目的 Actions 页面启用 Workflows,并启用 Upstream Sync Action,启用之后即可开启每小时定时自动更新:

![自动更新](./docs/images/enable-actions.jpg)

![启用自动更新](./docs/images/enable-actions-sync.jpg)

### 手动更新代码

如果你想让手动立即更新,可以查看 [Github 的文档](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork) 了解如何让 fork 的项目与上游代码同步。

Expand Down
File renamed without changes.
Binary file added docs/images/enable-actions-sync.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/enable-actions.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/vercel/vercel-create-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/vercel/vercel-create-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/vercel/vercel-create-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/vercel/vercel-env-edit.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/vercel/vercel-redeploy.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions docs/vercel-cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Vercel 的使用说明

## 如何新建项目
当你从 Github fork 本项目之后,需要重新在 Vercel 创建一个全新的 Vercel 项目来重新部署,你需要按照下列步骤进行。

![vercel-create-1](./images/vercel/vercel-create-1.jpg)
1. 进入 Vercel 控制台首页;
2. 点击 Add New;
3. 选择 Project。

![vercel-create-2](./images/vercel/vercel-create-2.jpg)
1. 在 Import Git Repository 处,搜索 chatgpt-next-web;
2. 选中新 fork 的项目,点击 Import。

![vercel-create-3](./images/vercel/vercel-create-3.jpg)
1. 在项目配置页,点开 Environmane Variables 开始配置环境变量;
2. 依次新增名为 OPENAI_API_KEY 和 CODE 的环境变量;
3. 填入环境变量对应的值;
4. 点击 Add 确认增加环境变量;
5. 请确保你添加了 OPENAI_API_KEY,否则无法使用;
6. 点击 Deploy,创建完成,耐心等待 5 分钟左右部署完成。

## 如何增加自定义域名
[TODO]

## 如何更改环境变量
![vercel-env-edit](./images/vercel/vercel-env-edit.jpg)
1. 进去 Vercel 项目内部控制台,点击顶部的 Settings 按钮;
2. 点击左侧的 Environment Variables;
3. 点击已有条目的右侧按钮;
4. 选择 Edit 进行编辑,然后保存即可。

⚠️️ 注意:每次修改完环境变量,你都需要[重新部署项目](#如何重新部署)来让改动生效!

## 如何重新部署
![vercel-redeploy](./images/vercel/vercel-redeploy.jpg)
1. 进入 Vercel 项目内部控制台,点击顶部的 Deployments 按钮;
2. 选择列表最顶部一条的右侧按钮;
3. 点击 Redeploy 即可重新部署。

0 comments on commit 3ee99ca

Please sign in to comment.