# Deploy Workflow

## 1. Push from Windows
cd D:\New_E_Drive\strotherfab.com\app-repo
git add . && git commit -m "message" && git push

## 2. Deploy to server
su - scs -c "cd /home/scs/public_html/strother && git pull && npm run build"

## WARNING — Never run git or npm from WHM Terminal directly
WHM Terminal runs as root. Running `git` or `npm` as root there leaves
root-owned files inside `.git` (objects, refs, ORIG_HEAD) and can do the same
to `node_modules`/build output. The `scs` user can then no longer write new
objects, and the next deploy fails with:

    error: insufficient permission for adding an object to repository database .git/objects

This has happened more than once. Always deploy as the `scs` user, either:
- `ssh strother` from PowerShell, then run the commands in step 2, or
- from WHM Terminal, prefix every command with `su - scs -c "..."` as shown
  above — never run `git`/`npm` bare as root.

If `.git` ever ends up root-owned again, fix it with:

    sudo chown -R scs:scs /home/scs/public_html/strother/.git
