fix(auth): suppress SSR warning during build + add deploy docs to FRONTEND.md
- Move 'No user found in storage' log inside window check to avoid SSR logs - Add CI/CD deploy section with Forgejo pipeline instructions - Update documentation date
This commit is contained in:
parent
31fadc1b11
commit
0238195723
2 changed files with 42 additions and 2 deletions
|
|
@ -6,7 +6,46 @@
|
|||
|
||||
Frontend da plataforma GoHorse Jobs construído com **Next.js 15** e **App Router**.
|
||||
|
||||
> **Last Updated:** 2024-12-26
|
||||
> **Last Updated:** 2026-01-03
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Deploy (CI/CD)
|
||||
|
||||
### Ambientes
|
||||
|
||||
| Ambiente | URL | Branch |
|
||||
|----------|-----|--------|
|
||||
| **DEV** | https://dev.gohorsejobs.com | `dev` |
|
||||
| **PRD** | https://gohorsejobs.com | `main` |
|
||||
|
||||
### Pipeline Forgejo
|
||||
|
||||
A pipeline está configurada em `.forgejo/workflows/deploy.yaml` e é triggerada automaticamente ao fazer push em `dev` com mudanças em `frontend/`.
|
||||
|
||||
**Fluxo:**
|
||||
|
||||
1. **Build local:** `podman build -t forgejo-gru.rede5.com.br/rede5/gohorsejobs-frontend:latest .`
|
||||
2. **Push para registry:** `podman push forgejo-gru.rede5.com.br/rede5/gohorsejobs-frontend:latest`
|
||||
3. **Commit e push:** `git push origin dev && git push forgejo dev`
|
||||
4. **Pipeline detecta mudanças** em `frontend/`
|
||||
5. **Deploy via SSH:** Pull da imagem + restart do serviço
|
||||
|
||||
```bash
|
||||
# Comandos executados pela pipeline no servidor
|
||||
podman pull forgejo-gru.rede5.com.br/rede5/gohorsejobs-frontend:latest
|
||||
sudo systemctl restart gohorsejobs-frontend-dev
|
||||
```
|
||||
|
||||
### Verificar Pipeline
|
||||
|
||||
```bash
|
||||
# Via browser
|
||||
https://forgejo-gru.rede5.com.br/rede5/gohorsejobs/actions
|
||||
|
||||
# Testar se está rodando
|
||||
curl -s https://dev.gohorsejobs.com | head -c 200
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -99,8 +99,9 @@ export function getCurrentUser(): User | null {
|
|||
console.log("%c[AUTH] User Loaded from Storage", "color: #10b981", user.email);
|
||||
return user;
|
||||
}
|
||||
}
|
||||
// Only log warning in browser, not during SSR
|
||||
console.warn("%c[AUTH] No user found in storage", "color: #f59e0b");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue