mirror of
https://github.com/ClovertaTheTrilobita/SanYeCao-blog.git
synced 2026-09-04 20:55:41 +00:00
Compare commits
7 commits
531d0263da
...
a506012a42
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a506012a42 | ||
| c4a1c21f49 | |||
|
|
c9d5ed26d2 | ||
| b45eb418c0 | |||
|
|
98923bf0b8 | ||
| 2e8f53bc5b | |||
| 873fe50a44 |
4 changed files with 70 additions and 13 deletions
20
.github/workflows/deploy.yml
vendored
20
.github/workflows/deploy.yml
vendored
|
|
@ -105,6 +105,15 @@ jobs:
|
||||||
dist/ \
|
dist/ \
|
||||||
${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}/
|
${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}/
|
||||||
|
|
||||||
|
- name: Submit to IndexNow
|
||||||
|
uses: bojieyang/indexnow-action@v3
|
||||||
|
with:
|
||||||
|
sitemap-location: '${{ vars.SITE_URL }}sitemap-index.xml'
|
||||||
|
key: ${{ vars.INDEXNOW_KEY }}
|
||||||
|
lastmod-required: false
|
||||||
|
endpoint: api.indexnow.org
|
||||||
|
limit: 1000
|
||||||
|
|
||||||
manual-deploy:
|
manual-deploy:
|
||||||
if: github.event_name == 'workflow_dispatch'
|
if: github.event_name == 'workflow_dispatch'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -165,4 +174,13 @@ jobs:
|
||||||
--no-group \
|
--no-group \
|
||||||
-e "ssh -p ${DEPLOY_PORT}" \
|
-e "ssh -p ${DEPLOY_PORT}" \
|
||||||
dist/ \
|
dist/ \
|
||||||
${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}/
|
${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}/
|
||||||
|
|
||||||
|
- name: Submit to IndexNow
|
||||||
|
uses: bojieyang/indexnow-action@v3
|
||||||
|
with:
|
||||||
|
sitemap-location: '${{ vars.SITE_URL }}sitemap.xml'
|
||||||
|
key: ${{ vars.INDEXNOW_KEY }}
|
||||||
|
lastmod-required: false
|
||||||
|
endpoint: api.indexnow.org
|
||||||
|
limit: 1000
|
||||||
|
|
@ -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`。
|
||||||
|
|
|
||||||
1
public/888c64d8d7d9a2b605bcd5277021a414.txt
Normal file
1
public/888c64d8d7d9a2b605bcd5277021a414.txt
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
888c64d8d7d9a2b605bcd5277021a414
|
||||||
Loading…
Reference in a new issue