From a66c99cbfb59b424888b156d61ae73ae3f40a6b6 Mon Sep 17 00:00:00 2001 From: Yamamoto Date: Sat, 3 Jan 2026 20:07:34 -0300 Subject: [PATCH] feat: add deploy-frontend workflow for stable deployments --- .agent/workflows/deploy-frontend.md | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .agent/workflows/deploy-frontend.md diff --git a/.agent/workflows/deploy-frontend.md b/.agent/workflows/deploy-frontend.md new file mode 100644 index 0000000..404698b --- /dev/null +++ b/.agent/workflows/deploy-frontend.md @@ -0,0 +1,48 @@ +--- +description: Deploy Frontend to Apolo (dev.gohorsejobs.com) +--- +# Deploy Frontend + +**IMPORTANT**: Always use `--build-arg` to set production URLs. Never rely on Dockerfile defaults. + +// turbo-all + +## Steps + +1. Login to Forgejo Registry: +```bash +podman login -u 'y@rede5.com.br' forgejo-gru.rede5.com.br +``` + +2. Build with Production URLs: +```bash +cd /home/yamamoto/lab/gohorsejobs +podman build \ + --build-arg NEXT_PUBLIC_API_URL=https://api-tmp.gohorsejobs.com \ + --build-arg NEXT_PUBLIC_BACKOFFICE_URL=https://b-tmp.gohorsejobs.com \ + -t forgejo-gru.rede5.com.br/rede5/gohorsejobs-frontend:latest \ + -f frontend/Dockerfile frontend/ +``` + +3. Push to Registry: +```bash +podman push forgejo-gru.rede5.com.br/rede5/gohorsejobs-frontend:latest +``` + +4. Deploy on Apolo: +```bash +ssh root@apolo 'podman pull forgejo-gru.rede5.com.br/rede5/gohorsejobs-frontend:latest && systemctl restart gohorsejobs-frontend-dev' +``` + +5. Verify: +```bash +ssh root@apolo 'systemctl status gohorsejobs-frontend-dev --no-pager | tail -5' +``` + +## Environment Reference + +| Variable | Production Value | +|----------|------------------| +| `NEXT_PUBLIC_API_URL` | `https://api-tmp.gohorsejobs.com` | +| `NEXT_PUBLIC_BACKOFFICE_URL` | `https://b-tmp.gohorsejobs.com` | +| `NEXT_PUBLIC_SEEDER_API_URL` | `https://seeder.gohorsejobs.com` |