Add Gitea webhook auto-deploy scripts and config template.
Co-authored-by: Cursor <cursoragent@cursor.com>
这个提交包含在:
28
deploy/config.example.php
普通文件
28
deploy/config.example.php
普通文件
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* 复制为 config.php 并填写实际值(config.php 已加入 .gitignore,勿提交密钥)
|
||||
*
|
||||
* Gitea 仓库 → 设置 → Web 钩子 → 添加 Web 钩子:
|
||||
* - 请求 URL: https://chufang.gynhc.com/gitea_webhook.php
|
||||
* - 密钥: 与下方 webhook_secret 相同
|
||||
* - 触发事件: 推送
|
||||
*/
|
||||
return [
|
||||
// Gitea Web 钩子「密钥」
|
||||
'webhook_secret' => '请改为随机长字符串',
|
||||
|
||||
// 站点根目录(含 .git 的项目目录,非 public)
|
||||
'deploy_path' => '/www/wwwroot/chufang.gynhc.com',
|
||||
|
||||
// 仅在该分支 push 时部署
|
||||
'branch' => 'main',
|
||||
|
||||
// 部署 shell 脚本(相对 deploy_path 或绝对路径)
|
||||
'deploy_script' => 'scripts/gitea-deploy.sh',
|
||||
|
||||
// 可选:仅允许这些 IP 调用(Gitea 服务器出口 IP),留空则不校验
|
||||
'allowed_ips' => [],
|
||||
|
||||
// 是否在拉代码后执行 composer install(vendor 未进仓库时建议 true)
|
||||
'run_composer' => true,
|
||||
];
|
||||
在新工单中引用
屏蔽一个用户