# Threejs Deploy Pipeline

> Use when deploying Three.js sites — optimized Vite build, GitHub Actions CI/CD, Hostinger/Netlify/Vercel/Pages targets, Nginx, health checks. Triggers on "deploy threejs site", "vite build threejs", "hostinger deploy threejs", "netlify threejs deploy", "vercel threejs deploy", "ci/cd threejs".

- Skill: `majinmagros/threejs-deploy-pipeline` (Agent Skill, multi-file: 8 files)
- Install (CLI): `npx get-skill add majinmagros/threejs-deploy-pipeline`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majinmagros/threejs-deploy-pipeline/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: majinmagros (https://skillmd.com/u/majinmagros)
- Updated: 2026-11-19
- Page: https://skillmd.com/skills/majinmagros/threejs-deploy-pipeline

---


# Three.js Deploy Pipeline — Sites Three.js em Produção

Pipeline CI/CD: **Vite build otimizado → testes → deploy automático** (Hostinger/Netlify/Vercel/GitHub Pages) + Nginx + health check. Artefatos prontos em `references/`.

## Quando usar (gatilhos concretos)

- "Deploy automático do meu site Three.js"
- "Pipeline CI/CD para projeto Three.js + Vite"
- "Deploy no Hostinger/Netlify/Vercel via GitHub Actions"
- "Build otimizado para Three.js (code splitting, tree shaking)"
- "Deploy contínuo em VPS Hostinger KVM1"

## Quando NÃO usar

- Composição de cena Three.js → use `threejs-scene-composer`
- Shaders customizados → use `threejs-shader-effects`
- Patterns responsivos → use `threejs-responsive-patterns`

## Pipeline (resumo)

```
Push (main) → Vite Build (otimizado) → Testes (unit/e2e) → Deploy (auto)
                                                        → Hostinger / Netlify / Vercel / GitHub Pages
```

**Build** (`references/vite.config.js`): terser (drop console/debugger), manualChunks (`three-core`, `three-addons`, `gsap`, `vendor`), cache busting por tipo (images/fonts/models), target es2022, COOP/COEP headers, `optimizeDeps` three+gsap.

**CI/CD** (`references/deploy.yml`): 7 jobs — lint (ESLint+tsc+Prettier) → test (unit + Playwright) → build (artifact `dist`) → deploy-hostinger (zip + SSH + nginx reload) / deploy-netlify / deploy-vercel / deploy-github-pages. Só `main` deploya.

**Deploy local** (`references/deploy.sh`): `./deploy.sh [production|staging] [hostinger|netlify|vercel|github-pages]` — build → checa tamanho → scp/ssh, `netlify deploy`, `vercel --prod` ou `gh-pages`.

**Servidor** (`references/nginx.conf`): HTTP→HTTPS, gzip, cache 1y em `/assets/` (immutable), SPA fallback, security headers + CSP, Permissions-Policy. **Env** (`references/env.example`): production/staging.

**Monitoramento** (`references/health-check.js` + `references/monitor.yml`): checa status, presença de three/canvas/scripts e tempo de resposta; cron a cada 15min.

```bash
# Uso mais comum (Hostinger VPS):
npm run build && ./references/deploy.sh production hostinger
```

## Checklist de Deploy

- [ ] Vite config otimizado (code splitting, tree shaking, terser)
- [ ] GitHub Actions (lint → test → build → deploy)
- [ ] Targets: Hostinger, Netlify, Vercel, GitHub Pages
- [ ] Nginx (cache, compressão, headers) + health check + cron 15min
- [ ] Rollback strategy documentado

## Adapters (Por Plataforma)

