# Deploy do ÚNIKKO Winery Ventures

Site `unikkowineryventures.com.br`, conectado ao repositório `FCJ-VB/unikkko-ventures` e ao projeto Lovable `unikkko-ventures.lovable.app`.

- Checkout na VM: `/var/www/html/unikkowineryventures/unikkko-ventures`, dono `deploy`.
- Serviço: `unikkowineryventures.service`, Node em `127.0.0.1:3013`.
- Apache: `ops/apache-unikkowineryventures.com.br.conf` redireciona HTTP para HTTPS; `ops/apache-unikkowineryventures.com.br-le-ssl.conf` atende HTTPS.
- Certificado Let's Encrypt para o domínio principal e `www`; renovação automática via `certbot.timer` na VM.

## HTTPS

Após confirmar que os registros A de ambos os nomes apontam para a VM:

```bash
sudo certbot --apache --non-interactive --agree-tos \
  --cert-name unikkowineryventures.com.br \
  -d unikkowineryventures.com.br -d www.unikkowineryventures.com.br \
  --redirect
sudo certbot renew --dry-run --cert-name unikkowineryventures.com.br
```

## Build

```bash
npm ci --no-audit --no-fund
npm run build
test -f .output/server/index.mjs
for asset in public/media/unikko/*; do test -s ".output/public/${asset#public/}"; done
```

## Deploy

O workflow `.github/workflows/deploy.yml` compila pushes e PRs para `main`. Com `ENABLE_EC2_DEPLOY=true`, publica na VM por VPN/SSH.

```bash
sudo -n -u deploy bash /var/www/html/unikkowineryventures/unikkko-ventures/deploy.sh
```
