Files
sisai-world/etc/svr_git_hooks_post-receive
2025-10-06 21:31:13 +09:00

16 lines
381 B
Plaintext

# Git hooks in server's ~/your-app.git/hooks/post-receive
#!/bin/bash
TARGET_DIR=~/sisai-world
GIT_DIR=~/cicd/sisai-world-cicd.git
BRANCH=main
# Checkout the code to the target directory
git --work-tree=$TARGET_DIR --git-dir=$GIT_DIR checkout -f $BRANCH
# Navigate to the target directory
cd $TARGET_DIR
# Our code support hot reload, refer 'Hot reload support' in process.js