update README

This commit is contained in:
Jing Hua 2023-03-15 22:01:32 +08:00
parent 94e7da2260
commit 38c0820c65
2 changed files with 30 additions and 11 deletions

View file

@ -117,15 +117,24 @@ Free ChatGPT 已经包含了大量的功能。您可以使用以下功能:
1. 创建一个 GitHub 账户(如果您还没有账户)。 1. 创建一个 GitHub 账户(如果您还没有账户)。
2. 给此[存储库](https://github.com/ztjhz/FreeChatGPT) 一个星星 ⭐️ 2. 给此[存储库](https://github.com/ztjhz/FreeChatGPT) 一个星星 ⭐️
3. Fork 此[存储库](https://github.com/ztjhz/FreeChatGPT) 3. Fork 此[存储库](https://github.com/ztjhz/FreeChatGPT)
4. 在您的 forked 存储库中点击 `Actions` 4. 如果你不使用自定义域名,需要配置你的 `vite.config.ts` 文件,在 `export default defineConfig({...})` 块内添加 `base: '/<REPO>/'`,其中 `<REPO>` 是你的 GitHub 仓库名称,可以从 `https://<USERNAME>.github.io/<REPO>` 获得(如果你没有改过,`<REPO>` 应该是 `FreeChatGPT`)。代码应该是这样的
```js
export default defineConfig({
base: '/REPO/',
/* 其余的配置在这里 */
});
```
5. 在您的 forked 存储库中点击 `Actions`
![image](https://user-images.githubusercontent.com/59118459/223751928-cf2b91b9-4663-4a36-97de-5eb751b32c7e.png) ![image](https://user-images.githubusercontent.com/59118459/223751928-cf2b91b9-4663-4a36-97de-5eb751b32c7e.png)
5. 在左侧边栏中,点击 `Deploy to GitHub Pages` 6. 在左侧边栏中,点击 `Deploy to GitHub Pages`
![image](https://user-images.githubusercontent.com/59118459/223752459-183ec23f-72f5-436e-a088-e3386492b8cb.png) ![image](https://user-images.githubusercontent.com/59118459/223752459-183ec23f-72f5-436e-a088-e3386492b8cb.png)
6. 在运行的工作流列表上方,选择 `Run workflow` 7. 在运行的工作流列表上方,选择 `Run workflow`
![image](https://user-images.githubusercontent.com/59118459/223753340-1270e038-d213-4d6f-938c-66a30dad7c88.png) ![image](https://user-images.githubusercontent.com/59118459/223753340-1270e038-d213-4d6f-938c-66a30dad7c88.png)
7. 现在,转到 `Settings` 选项卡 8. 现在,转到 `Settings` 选项卡
![image](https://user-images.githubusercontent.com/59118459/223753577-9b6f8266-26e8-471b-8f45-a1a02fbab232.png) ![image](https://user-images.githubusercontent.com/59118459/223753577-9b6f8266-26e8-471b-8f45-a1a02fbab232.png)
8. 在左侧边栏中,单击 `Pages` ,在右侧区域中,为 `Source` 选择 `Deploy from a branch`,为 `Branch` 选择 `gh-pages`。然后在顶部部分,您可以看到 "Your site is live at `XXX`"。 9. 在左侧边栏中,单击 `Pages` ,在右侧区域中,为 `Source` 选择 `Deploy from a branch`,为 `Branch` 选择 `gh-pages`。然后在顶部部分,您可以看到 "Your site is live at `XXX`"。
![image](https://user-images.githubusercontent.com/59118459/223753724-89f6452e-a441-48b8-8665-7a5e515d2a57.png) ![image](https://user-images.githubusercontent.com/59118459/223753724-89f6452e-a441-48b8-8665-7a5e515d2a57.png)
### 在本地运行 ### 在本地运行

View file

@ -124,15 +124,25 @@ If you'd like to run your own instance of Free ChatGPT, you can easily do so by
1. Create a GitHub account (if you don't have one already) 1. Create a GitHub account (if you don't have one already)
2. Star this [repository](https://github.com/ztjhz/FreeChatGPT) ⭐️ 2. Star this [repository](https://github.com/ztjhz/FreeChatGPT) ⭐️
3. Fork this [repository](https://github.com/ztjhz/FreeChatGPT) 3. Fork this [repository](https://github.com/ztjhz/FreeChatGPT)
4. In your forked repository, click on `Actions` 4. If you are not using custom domain, configure your `vite.config.ts` file by adding `base: '/<REPO>/'` inside the `export default defineConfig({...})` block, where `<REPO>` is the name of your repository on GitHub, obtained from `https://<USERNAME>.github.io/<REPO>` (`<REPO>` should be `FreeChatGPT` if you did not change it). The code should look like this:
```js
export default defineConfig({
base: '/REPO/',
/* Rest of the configuration here */
});
```
5. Repository settings > Secrets > Actions > General > Tick "Read and write permissions"
6. In your forked repository, click on `Actions`
![image](https://user-images.githubusercontent.com/59118459/223751928-cf2b91b9-4663-4a36-97de-5eb751b32c7e.png) ![image](https://user-images.githubusercontent.com/59118459/223751928-cf2b91b9-4663-4a36-97de-5eb751b32c7e.png)
5. In the left sidebar, click on `Deploy to GitHub Pages` 7. In the left sidebar, click on `Deploy to GitHub Pages`
![image](https://user-images.githubusercontent.com/59118459/223752459-183ec23f-72f5-436e-a088-e3386492b8cb.png) ![image](https://user-images.githubusercontent.com/59118459/223752459-183ec23f-72f5-436e-a088-e3386492b8cb.png)
6. Above the list of workflow runs, select `Run workflow`. 8. Above the list of workflow runs, select `Run workflow`.
![image](https://user-images.githubusercontent.com/59118459/223753340-1270e038-d213-4d6f-938c-66a30dad7c88.png) ![image](https://user-images.githubusercontent.com/59118459/223753340-1270e038-d213-4d6f-938c-66a30dad7c88.png)
7. Now, navigate to the `Settings` tab 9. Now, navigate to the `Settings` tab
![image](https://user-images.githubusercontent.com/59118459/223753577-9b6f8266-26e8-471b-8f45-a1a02fbab232.png) ![image](https://user-images.githubusercontent.com/59118459/223753577-9b6f8266-26e8-471b-8f45-a1a02fbab232.png)
8. In the left sidebar, click on `Pages` and in the right section, select `Deploy from a branch` for `Source` and `gh-pages` for `Branch`. Then at the top section, you can see that "Your site is live at `XXX`". 10. In the left sidebar, click on `Pages` and in the right section, select `Deploy from a branch` for `Source` and `gh-pages` for `Branch`. Then at the top section, you can see that "Your site is live at `XXX`".
![image](https://user-images.githubusercontent.com/59118459/223753724-89f6452e-a441-48b8-8665-7a5e515d2a57.png) ![image](https://user-images.githubusercontent.com/59118459/223753724-89f6452e-a441-48b8-8665-7a5e515d2a57.png)
### Running it locally ### Running it locally