added v0 ci/cd
This commit is contained in:
72
DEPLOY.md
72
DEPLOY.md
@@ -147,46 +147,48 @@ Admin panel: `https://biztaghavi.com/admin`
|
||||
|
||||
## 6. Nginx config
|
||||
|
||||
Port: **3009** (next available after 3008 for Khanehban)
|
||||
|
||||
Create `/etc/nginx/sites-available/biztaghavi.com`:
|
||||
|
||||
```nginx
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
server_name biztaghavi.com www.biztaghavi.com;
|
||||
|
||||
ssl_certificate /etc/ssl/certs/nodecloud-selfsigned.crt;
|
||||
ssl_certificate_key /etc/ssl/private/nodecloud-selfsigned.key;
|
||||
|
||||
client_max_body_size 20M;
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:3009;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_read_timeout 60;
|
||||
proxy_send_timeout 60;
|
||||
}
|
||||
}
|
||||
```
|
||||
Port: **3009**
|
||||
The config file lives at `nginx/biztaghavi.conf` in this repo.
|
||||
|
||||
```bash
|
||||
ln -s /etc/nginx/sites-available/biztaghavi.com /etc/nginx/sites-enabled/
|
||||
nginx -t && nginx -s reload
|
||||
# Install on server
|
||||
cp /srv/nodecloud/apps/biztaghavi/nginx/biztaghavi.conf /etc/nginx/sites-available/biztaghavi
|
||||
ln -sf /etc/nginx/sites-available/biztaghavi /etc/nginx/sites-enabled/biztaghavi
|
||||
nginx -t && systemctl reload nginx
|
||||
```
|
||||
|
||||
In **ArvanCloud dashboard**: SSL mode = "Full", origin = `193.105.234.35`, purge cache.
|
||||
Then issue SSL with Certbot (HTTP must be working first):
|
||||
|
||||
> Port 3009 must match the `ports` binding in `docker-compose.yml` — verify it's `"127.0.0.1:3009:3000"`.
|
||||
```bash
|
||||
certbot --nginx -d biztaghavi.com -d www.biztaghavi.com
|
||||
```
|
||||
|
||||
In **ArvanCloud dashboard**: SSL mode = "Full (strict)", origin = `193.105.234.35`, purge cache.
|
||||
|
||||
> Port **3009** must match the `ports` binding in `docker-compose.yml` — verify it's `"127.0.0.1:3009:3000"`.
|
||||
|
||||
---
|
||||
|
||||
## 6b. Gitea CI/CD Secrets
|
||||
|
||||
In the Gitea repo → **Settings → Secrets → Actions**, add:
|
||||
|
||||
| Secret name | Value |
|
||||
|-------------|-------|
|
||||
| `SERVER_HOST` | `193.105.234.35` |
|
||||
| `SERVER_USER` | `root` |
|
||||
| `SERVER_SSH_KEY` | Contents of private SSH key (ed25519 recommended) |
|
||||
|
||||
Generating a deploy key:
|
||||
|
||||
```bash
|
||||
# On your Mac
|
||||
ssh-keygen -t ed25519 -C "gitea-deploy" -f ~/.ssh/biztaghavi_deploy
|
||||
ssh-copy-id -i ~/.ssh/biztaghavi_deploy.pub root@193.105.234.35
|
||||
cat ~/.ssh/biztaghavi_deploy # paste this into SERVER_SSH_KEY secret
|
||||
```
|
||||
|
||||
Every push to `main` runs: lint → typecheck → SSH deploy → health check.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user