feat: enhance deployment script to clone repository if not present

This commit is contained in:
Asep Haryana Saputra
2026-05-22 21:38:52 +00:00
parent 80df164a2b
commit a0f9d307fd
3 changed files with 11 additions and 3 deletions
Submodule .claude/worktrees/agent-a4aa04a9c476f1c6d deleted from 64d63587c7
Submodule .claude/worktrees/agent-a535691b7def5bafe added at 80df164a2b
+10 -2
View File
@@ -89,8 +89,16 @@ jobs:
port: ${{ secrets.VPS_PORT || 22 }}
script: |
set -e
cd /opt/ZeaVis-Edu
git pull origin main
DEPLOY_PATH="${DEPLOY_PATH:-/opt/ZeaVis-Edu}"
if [ ! -d "$DEPLOY_PATH/.git" ]; then
mkdir -p "$DEPLOY_PATH"
git clone https://github.com/${{ github.repository }}.git "$DEPLOY_PATH"
fi
cd "$DEPLOY_PATH"
git checkout main
git pull --ff-only origin main
cat > .env << 'ENVEOF'
GITHUB_REPOSITORY=${{ github.repository }}