Migrate from Kirby CMS to Hugo with Gokarna theme
- Remove all Kirby/PHP files - Add Hugo config with Gokarna theme as git submodule - Add nginx + Hugo Dockerfile replacing PHP/Apache - Update deploy.php to run hugo after git pull - Update .gitignore for Hugo output Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,8 +4,7 @@
|
||||
* Called by Gitea on push to main branch.
|
||||
*
|
||||
* Set DEPLOY_SECRET in Gitea webhook settings and
|
||||
* configure the same value in the DEPLOY_SECRET env var
|
||||
* (or hardcode it below for simple setups).
|
||||
* configure the same value in the DEPLOY_SECRET env var.
|
||||
*/
|
||||
|
||||
$secret = getenv('DEPLOY_SECRET') ?: '';
|
||||
@@ -40,9 +39,9 @@ if ($ref !== 'refs/heads/main') {
|
||||
die('Ignored: not main branch.');
|
||||
}
|
||||
|
||||
// Run git pull (HOME must be set explicitly since PHP's shell_exec doesn't inherit it)
|
||||
// Pull latest and rebuild
|
||||
putenv('HOME=/var/www');
|
||||
$output = shell_exec('git -C /var/www/html pull 2>&1');
|
||||
$output = shell_exec('cd /var/www/html && git pull 2>&1 && git submodule update --init --recursive 2>&1 && hugo 2>&1');
|
||||
|
||||
http_response_code(200);
|
||||
header('Content-Type: text/plain');
|
||||
|
||||
Reference in New Issue
Block a user