#!/usr/bin/env node /** * Deploy script for skills-market-server * Usage: npm run deploy * * What it does: * 1. git push (local → remote repo) * 2. SSH into server and run deploy script */ const { execSync } = require('child_process') const SERVER_USER = 'Administrator' const SERVER_HOST = '118.145.101.146' const SERVER_PATH = 'C:\\apps\\skills-market-server' function run(cmd, opts = {}) { console.log(`\n$ ${cmd}`) execSync(cmd, { stdio: 'inherit', ...opts }) } // ── Push local changes ──────────────────────────────────────────── console.log('\n📦 Pushing to remote repo...') run('git push') // ── SSH: run deploy script on server ─────────────────────────────── console.log('\n🚀 Deploying to server...') run(`ssh ${SERVER_USER}@${SERVER_HOST} "cd /d ${SERVER_PATH} && deploy.bat"`) console.log('\n✅ Deploy done!\n')