mirror of
https://github.com/ClovertaTheTrilobita/SanYeCao-blog.git
synced 2026-09-04 20:55:41 +00:00
commit
a506012a42
3 changed files with 52 additions and 14 deletions
4
.github/workflows/deploy.yml
vendored
4
.github/workflows/deploy.yml
vendored
|
|
@ -108,7 +108,7 @@ jobs:
|
||||||
- name: Submit to IndexNow
|
- name: Submit to IndexNow
|
||||||
uses: bojieyang/indexnow-action@v3
|
uses: bojieyang/indexnow-action@v3
|
||||||
with:
|
with:
|
||||||
sitemap-location: '${{ env.SITE_URL }}sitemap-index.xml'
|
sitemap-location: '${{ vars.SITE_URL }}sitemap-index.xml'
|
||||||
key: ${{ vars.INDEXNOW_KEY }}
|
key: ${{ vars.INDEXNOW_KEY }}
|
||||||
lastmod-required: false
|
lastmod-required: false
|
||||||
endpoint: api.indexnow.org
|
endpoint: api.indexnow.org
|
||||||
|
|
@ -179,7 +179,7 @@ jobs:
|
||||||
- name: Submit to IndexNow
|
- name: Submit to IndexNow
|
||||||
uses: bojieyang/indexnow-action@v3
|
uses: bojieyang/indexnow-action@v3
|
||||||
with:
|
with:
|
||||||
sitemap-location: '${{ env.SITE_URL }}sitemap.xml'
|
sitemap-location: '${{ vars.SITE_URL }}sitemap.xml'
|
||||||
key: ${{ vars.INDEXNOW_KEY }}
|
key: ${{ vars.INDEXNOW_KEY }}
|
||||||
lastmod-required: false
|
lastmod-required: false
|
||||||
endpoint: api.indexnow.org
|
endpoint: api.indexnow.org
|
||||||
|
|
|
||||||
|
|
@ -88,10 +88,29 @@ Simply copy all contents of your `.env` file into the variable value.
|
||||||
|
|
||||||
Also in <b>`Settings > Secrets and variables > Actions`</b>, add four `Repository variables`:
|
Also in <b>`Settings > Secrets and variables > Actions`</b>, add four `Repository variables`:
|
||||||
|
|
||||||
| Variable Name | Value Example |
|
| **Variable Name** | **Value** |
|
||||||
| ------------- | --------------------------------------------------------------------------- |
|
| ----------------- | ------------------------------------------------------------ |
|
||||||
| `DEPLOY_HOST` | Server IP address, for example `192.168.1.1` |
|
| `DEPLOY_HOST` | The IP address of your server, e.g. `192.168.1.1` |
|
||||||
| `DEPLOY_PATH` | Deployment path on the server, for example `/www/wwwroot/blog.cloverta.top` |
|
| `DEPLOY_PATH` | The deployment path on the server, e.g. `/www/wwwroot/blog.cloverta.top` |
|
||||||
| `DEPLOY_PORT` | SSH port of the server, usually `22` |
|
| `DEPLOY_PORT` | The SSH port of your server, usually `22` |
|
||||||
| `DEPLOY_USER` | Login username, for example `root` |
|
| `DEPLOY_USER` | The login user, e.g. `root` |
|
||||||
|
| `INDEXNOW_KEY` | A string used as the key submitted to IndexNow. You can directly use `888c64d8d7d9a2b605bcd5277021a414` |
|
||||||
|
| `SITE_URL` | Your domain name, e.g. `https://blog.cloverta.top/`. Make sure to include the trailing slash |
|
||||||
|
|
||||||
|
#### About `INDEXNOW_KEY`
|
||||||
|
|
||||||
|
The repository's `Actions` workflow will automatically submit updates to [IndexNow](https://www.indexnow.org/). You need to generate a random key in the `public` directory so that IndexNow can verify that you own the website.
|
||||||
|
|
||||||
|
If you do not want to configure your own key, you can simply use the `Key` included in this repository:
|
||||||
|
|
||||||
|
```txt
|
||||||
|
888c64d8d7d9a2b605bcd5277021a414
|
||||||
|
```
|
||||||
|
|
||||||
|
If you want to generate your own key, you can use:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
openssl rand -hex 16
|
||||||
|
```
|
||||||
|
|
||||||
|
This will generate a random string. For example, if the output is `abcdefg123`, you need to save it as `public/abcdefg123.txt`, with the contents of the file also set to `abcdefg123`.
|
||||||
|
|
|
||||||
|
|
@ -88,10 +88,29 @@ PUBLIC_REMARK42_SITE_ID=
|
||||||
|
|
||||||
同样,在<b>`Settings > Secrets and variables > Actions`</b>中,添加四个`Repository variables`,分别为:
|
同样,在<b>`Settings > Secrets and variables > Actions`</b>中,添加四个`Repository variables`,分别为:
|
||||||
|
|
||||||
| 密钥名 | 内容 |
|
| 密钥名 | 内容 |
|
||||||
| ------------- | -------------------------------------------------------- |
|
| -------------- | ------------------------------------------------------------ |
|
||||||
| `DEPLOY_HOST` | 服务器IP地址,如`192.168.1.1` |
|
| `DEPLOY_HOST` | 服务器IP地址,如`192.168.1.1` |
|
||||||
| `DEPLOY_PATH` | 在服务器上的部署路径,如`/www/wwwroot/blog.cloverta.top` |
|
| `DEPLOY_PATH` | 在服务器上的部署路径,如`/www/wwwroot/blog.cloverta.top` |
|
||||||
| `DEPLOY_PORT` | 服务器SSH端口,一般是`22` |
|
| `DEPLOY_PORT` | 服务器SSH端口,一般是`22` |
|
||||||
| `DEPLOY_USER` | 登录用户,例如`root` |
|
| `DEPLOY_USER` | 登录用户,例如`root` |
|
||||||
|
| `INDEXNOW_KEY` | 提交至IndexNow的一串ID字符,可以直接填``888c64d8d7d9a2b605bcd5277021a414`` |
|
||||||
|
| `SITE_URL` | 你的域名,例如`https://blog.cloverta.top/`,注意结尾要带反斜杠 |
|
||||||
|
|
||||||
|
#### 关于`INDEXNOW_KEY`
|
||||||
|
|
||||||
|
仓库的`Actions`会自动向 [Index Now](https://www.indexnow.org/) 推送更新,你需要在`public`目录下生成一个随机的key向Index Now证明这个网站是你的。
|
||||||
|
|
||||||
|
如果懒得配可以直接用这个仓库中的`Key`
|
||||||
|
|
||||||
|
```txt
|
||||||
|
888c64d8d7d9a2b605bcd5277021a414
|
||||||
|
```
|
||||||
|
|
||||||
|
如果你想生成一个自己的,你可以使用
|
||||||
|
|
||||||
|
```bash
|
||||||
|
openssl rand -hex 16
|
||||||
|
```
|
||||||
|
|
||||||
|
生成一串随机字符,假设输出内容为`abcdefg123`,你需要将其保存到`public/abcdefg123.txt`,并且内容也为`abcdefg123`。
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue