**Goal:** one command on the VM updates the site to `main`, so a deploy does not depend on someone following the manual steps in `docs/vm.md`. **One-time setup on the VM** - [ ] Run the backend as a systemd service and not with `nohup`, so anyone with `sudo` can restart it, and it starts again after a crash or a reboot - [ ] Give a shared group write access to `/var/www/html/project2`, so publishing needs no `sudo` **Tasks** - [ ] Add `scripts/deploy.sh`. It stops at the first error and does this: 1. Check that the checkout is clean and on `main`, then `git pull --ff-only` 2. Back up the user tables (accounts, reviews, lists) to `~/backups`, and keep the newest five 3. Build the frontend before the backend is touched, so a build error leaves the site up 4. Run `npm ci`, `db:migrate` and `db:seed:demo` in the backend 5. Restart the backend and wait until `/graphql` answers 6. Copy the build to `/var/www/html/project2`, and delete files in `assets/` older than 14 days 7. Check that the site answers 200, the API returns a wine count, and the cache headers are right - [ ] Update `docs/vm.md`: "Update and restart" becomes "run the script", with the manual steps kept as a fallback, and the systemd service replaces "Backend with nohup" **Done when:** a group member has deployed `main` with `./scripts/deploy.sh` on the VM, the checks in step 7 pass, and the backend comes back by itself after `sudo systemctl restart`. **Not in this issue:** deploying automatically on a merge to `main`. That needs a runner on the VM and `sudo` without a password. The script is written so a runner can call it later. Related: #15 (CI), #85 (the deployed version should be up to date with `main`), #108 (also edits `docs/vm.md`, merge it first).