2.3 KiB
Deployment
The site is a static export. It is built on your machine and the result
(out/) is copied to the server — nothing is built on the server.
- Server:
185.226.116.88, userubuntu - Target dir:
/var/www/aramland-admin(its contents are fully replaced each deploy)
Deploy by pushing a git tag (automatic)
A versioned git hook (.githooks/pre-push) runs the local
build + upload whenever you push a tag:
git tag v1.0.0
git push origin v1.0.0 # ← hook builds locally, then uploads to the server
Normal branch pushes are unaffected — only tag pushes deploy.
The hook path is set via
git config core.hooksPath .githooks(already configured in this clone). On a fresh clone, run that once.
Deploy manually (no tag)
npm run deploy # = bash scripts/deploy.sh : build locally + upload
The password
Both paths use scripts/deploy.sh, which streams out/ over a
single SSH connection. By default SSH asks for the server password once per deploy.
To make it unattended (no prompt), provide the password without committing it:
- Create
.env.deployin the project root (already gitignored):DEPLOY_PASSWORD=your-server-password - Install
sshpass(the only piece that can feed a password to SSH non-interactively):- Linux/WSL:
sudo apt-get install -y sshpass - macOS:
brew install hudochenkov/sshpass/sshpass - Windows Git Bash has no sshpass — either deploy from WSL, or just answer the one password prompt.
- Linux/WSL:
Override the host/user/path too if needed (env or .env.deploy):
DEPLOY_HOST, DEPLOY_USER, DEPLOY_PATH.
More robust option: set up an SSH key (
ssh-copy-id ubuntu@185.226.116.88). Then deploys are unattended on any OS with no password or sshpass at all.
Notes / troubleshooting
- Permission denied writing the target: the
ubuntuuser must own it → on the server runsudo chown -R ubuntu:ubuntu /var/www/aramland-admin. - Web server: point nginx's site root at
/var/www/aramland-admin. The export usestrailingSlash: true, so clean URLs resolve to…/index.html. - The deploy replaces the directory contents (including dotfiles) in place; it does not touch nginx config or sibling folders.