Revisão Logo, Favicon, Robots
This commit is contained in:
@@ -0,0 +1,135 @@
|
||||
# CI/CD - Avanzato Tecnologia
|
||||
|
||||
## Estrutura do Pipeline
|
||||
|
||||
```
|
||||
Push para main/master
|
||||
|
|
||||
v
|
||||
+------------------+ +------------------+ +------------------+
|
||||
| BUILD | --> | PRESERVAR ASSETS | --> | DEPLOY |
|
||||
| | | | | |
|
||||
| - Checkout | | - Logo | | - SCP para VPS |
|
||||
| - npm install | | - Imagens | | - Limpar cache |
|
||||
| - npm run build | | - Favicon | | - Notificar |
|
||||
+------------------+ +------------------+ +------------------+
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Configurar Secrets no GitHub
|
||||
|
||||
Va em: **Settings > Secrets and variables > Actions > New repository secret**
|
||||
|
||||
| Secret | Descricao | Exemplo |
|
||||
|--------|-----------|---------|
|
||||
| `SSH_HOST` | IP ou dominio do servidor | `201.45.120.30` ou `avanzato.com.br` |
|
||||
| `SSH_USER` | Usuario SSH | `root` ou `deploy` |
|
||||
| `SSH_PRIVATE_KEY` | Chave SSH privada | `-----BEGIN OPENSSH PRIVATE KEY-----...` |
|
||||
| `SSH_PORT` | Porta SSH (opcional) | `22` |
|
||||
| `DEPLOY_PATH` | Caminho no servidor | `/var/www/avanzato` |
|
||||
| `STAGING_PATH` | Caminho staging (opcional) | `/var/www/avanzato-staging` |
|
||||
|
||||
### Como gerar a chave SSH:
|
||||
|
||||
```bash
|
||||
# No seu computador (NAO no servidor):
|
||||
ssh-keygen -t ed25519 -C "github-actions" -f ~/.ssh/github_actions
|
||||
|
||||
# Copiar publica para o servidor:
|
||||
ssh-copy-id -i ~/.ssh/github_actions.pub root@SEU_SERVIDOR
|
||||
|
||||
# Copiar privada para o GitHub Secret:
|
||||
cat ~/.ssh/github_actions
|
||||
# Cole o conteudo inteiro no secret SSH_PRIVATE_KEY
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Estrutura de Branches
|
||||
|
||||
```
|
||||
main/master --> Deploy automatico para producao
|
||||
staging --> Deploy automatico para staging (se existir)
|
||||
feature/* --> Apenas build (sem deploy)
|
||||
hotfix/* --> Apenas build (sem deploy)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Como Funciona
|
||||
|
||||
### Cenario 1: Deploy Automatico
|
||||
```
|
||||
1. Voce faz push para main
|
||||
2. GitHub Actions executa automaticamente
|
||||
3. Build + Deploy em ~2 minutos
|
||||
4. Site atualizado!
|
||||
```
|
||||
|
||||
### Cenario 2: Deploy Manual
|
||||
```
|
||||
1. Va em Actions > Build e Deploy
|
||||
2. Clique "Run workflow"
|
||||
3. Escolha: production ou staging
|
||||
4. Clique "Run"
|
||||
```
|
||||
|
||||
### Cenario 3: Pull Request
|
||||
```
|
||||
1. Cria PR para main
|
||||
2. CI executa build (testa se compila)
|
||||
3. NAO faz deploy
|
||||
4. Merge aprovado? Deploy automatico!
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Assets Customizados (Logo, Imagens)
|
||||
|
||||
Para preservar assets apos o deploy automatico:
|
||||
|
||||
### 1. Commitar assets no repositorio
|
||||
|
||||
```bash
|
||||
git add custom-assets/logo/logo.png
|
||||
git add custom-assets/images/
|
||||
git commit -m "Adiciona logo e imagens customizadas"
|
||||
git push origin main
|
||||
```
|
||||
|
||||
### 2. O pipeline faz sozinho
|
||||
|
||||
O workflow executa automaticamente:
|
||||
```bash
|
||||
bash scripts/preserve-assets.sh dist/
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Monitore os Deploys
|
||||
|
||||
- **GitHub Actions**: https://github.com/SEU_USUARIO/avanzato-site/actions
|
||||
- **Status**: Check verde = sucesso, X vermelho = falha
|
||||
- **Logs**: Clique no workflow para ver detalhes
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Deploy falhou?
|
||||
|
||||
1. **Verifique os secrets**: Settings > Secrets > Actions
|
||||
2. **Verifique a chave SSH**: `ssh -i ~/.ssh/github_actions root@SEU_SERVIDOR`
|
||||
3. **Verifique permissoes**: O usuario precisa de acesso de escrita no DEPLOY_PATH
|
||||
4. **Verifique logs**: Actions > Clique no workflow > Veja o passo que falhou
|
||||
|
||||
### Assets nao preservados?
|
||||
|
||||
1. Verifique se `custom-assets/` esta no repositorio
|
||||
2. Verifique se os arquivos estao comitados: `git ls-files custom-assets/`
|
||||
3. Verifique os logs do passo "Preservar assets customizados"
|
||||
|
||||
---
|
||||
|
||||
*Configurado em: Maio 2026*
|
||||
@@ -0,0 +1,162 @@
|
||||
# ============================================================================
|
||||
# CI/CD Pipeline - Avanzato Tecnologia
|
||||
# ============================================================================
|
||||
# Este workflow automatiza o build e deploy do site.
|
||||
#
|
||||
# TRIGGER: Push na branch main ou manual (workflow_dispatch)
|
||||
# ============================================================================
|
||||
|
||||
name: Build e Deploy
|
||||
|
||||
on:
|
||||
# Deploy automatico ao fazer push na main
|
||||
push:
|
||||
branches: [ main, master ]
|
||||
|
||||
# Deploy manual pelo botao "Run workflow" no GitHub
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
environment:
|
||||
description: 'Ambiente'
|
||||
required: true
|
||||
default: 'production'
|
||||
type: choice
|
||||
options:
|
||||
- production
|
||||
- staging
|
||||
|
||||
# Pull Request (apenas build, sem deploy)
|
||||
pull_request:
|
||||
branches: [ main, master ]
|
||||
|
||||
# Permissoes necessarias
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
# ==========================================================================
|
||||
# JOB 1: Build
|
||||
# ==========================================================================
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# Passo 1: Checkout do codigo
|
||||
- name: Checkout codigo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Passo 2: Setup Node.js
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
|
||||
# Passo 3: Instalar dependencias
|
||||
- name: Instalar dependencias
|
||||
run: npm ci
|
||||
|
||||
# Passo 4: Build
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
# Passo 5: Upload do artefato (para usar no job de deploy)
|
||||
- name: Upload artefato
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: dist
|
||||
path: dist/
|
||||
retention-days: 1
|
||||
|
||||
# ==========================================================================
|
||||
# JOB 2: Deploy para Servidor (Producao)
|
||||
# ==========================================================================
|
||||
deploy-production:
|
||||
name: Deploy - Producao
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
# So executa na branch main/master ou manual com environment=production
|
||||
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.environment == 'production'
|
||||
|
||||
steps:
|
||||
# Passo 1: Download do artefato buildado
|
||||
- name: Download artefato
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: dist
|
||||
path: dist/
|
||||
|
||||
# Passo 2: Preservar assets customizados (logo, imagens)
|
||||
- name: Preservar assets customizados
|
||||
run: |
|
||||
if [ -d "custom-assets" ]; then
|
||||
echo "Preservando assets customizados..."
|
||||
bash scripts/preserve-assets.sh dist/
|
||||
else
|
||||
echo "Nenhum asset customizado encontrado."
|
||||
fi
|
||||
|
||||
# Passo 3: Deploy via SCP (SSH)
|
||||
- name: Deploy para servidor
|
||||
uses: appleboy/scp-action@v0.1.7
|
||||
with:
|
||||
host: ${{ secrets.SSH_HOST }}
|
||||
username: ${{ secrets.SSH_USER }}
|
||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
port: ${{ secrets.SSH_PORT || '22' }}
|
||||
source: "dist/*"
|
||||
target: ${{ secrets.DEPLOY_PATH || '/var/www/avanzato' }}
|
||||
strip_components: 1
|
||||
rm: true # Remove arquivos antigos antes de copiar
|
||||
|
||||
# Passo 4: Notificar (opcional - webhook Discord/Slack)
|
||||
- name: Notificar sucesso
|
||||
if: success()
|
||||
run: |
|
||||
echo "Deploy para producao concluido com sucesso!"
|
||||
echo "Site: https://avanzato.com.br"
|
||||
|
||||
# ==========================================================================
|
||||
# JOB 3: Deploy para Staging (Opcional)
|
||||
# ==========================================================================
|
||||
deploy-staging:
|
||||
name: Deploy - Staging
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
# So executa em push para branch staging ou manual
|
||||
if: github.ref == 'refs/heads/staging' || github.event.inputs.environment == 'staging'
|
||||
|
||||
steps:
|
||||
- name: Download artefato
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: dist
|
||||
path: dist/
|
||||
|
||||
- name: Deploy para staging
|
||||
uses: appleboy/scp-action@v0.1.7
|
||||
with:
|
||||
host: ${{ secrets.SSH_HOST }}
|
||||
username: ${{ secrets.SSH_USER }}
|
||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
port: ${{ secrets.SSH_PORT || '22' }}
|
||||
source: "dist/*"
|
||||
target: ${{ secrets.STAGING_PATH || '/var/www/avanzato-staging' }}
|
||||
strip_components: 1
|
||||
rm: true
|
||||
|
||||
# ==========================================================================
|
||||
# JOB 4: Notificacao de Falha
|
||||
# ==========================================================================
|
||||
notify-failure:
|
||||
name: Notificar Falha
|
||||
needs: [build, deploy-production]
|
||||
runs-on: ubuntu-latest
|
||||
if: failure()
|
||||
|
||||
steps:
|
||||
- name: Notificar falha
|
||||
run: |
|
||||
echo "ALERTA: O deploy falhou!"
|
||||
echo "Verifique os logs em: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
# Build
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Cache
|
||||
.cache
|
||||
.vite
|
||||
|
||||
# Dependencias
|
||||
node_modules
|
||||
|
||||
# Ambiente (NUNCA commite!)
|
||||
.env
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Editor
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Scripts de deploy local
|
||||
scripts/.env.local
|
||||
@@ -1,205 +0,0 @@
|
||||
# Release HML
|
||||
|
||||
Data: sáb 30 mai 2026 23:54:46 -03
|
||||
|
||||
Ambiente:
|
||||
HML
|
||||
|
||||
Descrição:
|
||||
Revisão Logo, Favicon, Robots
|
||||
|
||||
Branch:
|
||||
develop
|
||||
|
||||
Arquivos alterados antes do commit:
|
||||
D .github/workflows/README-CI-CD.md
|
||||
D .github/workflows/deploy.yml
|
||||
D .gitignore
|
||||
M index.html
|
||||
D infra/releases/2026-05-30_23-52-07_HML.md
|
||||
M node_modules/.package-lock.json
|
||||
M node_modules/.vite/deps/@radix-ui_react-dialog.js
|
||||
M node_modules/.vite/deps/@radix-ui_react-radio-group.js
|
||||
M node_modules/.vite/deps/@radix-ui_react-select.js
|
||||
M node_modules/.vite/deps/_metadata.json
|
||||
M package-lock.json
|
||||
M package.json
|
||||
M public/robots.txt
|
||||
M public/sitemap.xml
|
||||
M scripts/dev.sh
|
||||
M src/App.tsx
|
||||
M src/components/HomologationBanner.tsx
|
||||
M src/config/mautic.ts
|
||||
M src/config/site.ts
|
||||
M src/main.tsx
|
||||
M src/pages/Blog.tsx
|
||||
M src/pages/Cases.tsx
|
||||
M src/pages/Condominios.tsx
|
||||
M src/pages/Privacidade.tsx
|
||||
M src/pages/Sobre.tsx
|
||||
M src/pages/Tecnologias.tsx
|
||||
M src/pages/Termos.tsx
|
||||
M src/pages/nichos/Advocacia.tsx
|
||||
M src/pages/nichos/BackupCorporativo.tsx
|
||||
M src/pages/nichos/Contabilidade.tsx
|
||||
M src/pages/nichos/FirewallPfSense.tsx
|
||||
M src/pages/nichos/Monitoramento.tsx
|
||||
M src/pages/nichos/VoipEmpresarial.tsx
|
||||
M src/pages/services/Backup.tsx
|
||||
M src/pages/services/CloudComputing.tsx
|
||||
M src/pages/services/Consultoria.tsx
|
||||
M src/pages/services/Noc.tsx
|
||||
M src/pages/services/Pabx.tsx
|
||||
M src/pages/services/Redes.tsx
|
||||
M src/pages/services/Seguranca.tsx
|
||||
M src/pages/services/Servidores.tsx
|
||||
M src/pages/services/Suporte.tsx
|
||||
M src/pages/services/TiGerenciada.tsx
|
||||
M src/pages/tech/Cisco.tsx
|
||||
M src/pages/tech/Linux.tsx
|
||||
M src/pages/tech/PfSense.tsx
|
||||
M src/pages/tech/Proxmox.tsx
|
||||
M src/pages/tech/Sharepoint.tsx
|
||||
M src/pages/tech/Vmware.tsx
|
||||
M src/pages/tech/WindowsServer.tsx
|
||||
M src/sections/Footer.tsx
|
||||
M src/sections/Navigation.tsx
|
||||
M vite.config.ts
|
||||
?? DEPLOY-DOCKER.md
|
||||
?? GUIA-NGINX.md
|
||||
?? infra/releases/2026-05-30_23-54-46_HML.md
|
||||
?? nginx-docker.conf
|
||||
?? node_modules/.vite/deps/chunk-INCCO7S4.js
|
||||
?? node_modules/.vite/deps/chunk-INCCO7S4.js.map
|
||||
?? node_modules/.vite/deps/chunk-L2OGOWTU.js
|
||||
?? node_modules/.vite/deps/chunk-L2OGOWTU.js.map
|
||||
?? node_modules/.vite/deps/chunk-LIWCVBQK.js
|
||||
?? node_modules/.vite/deps/chunk-LIWCVBQK.js.map
|
||||
?? node_modules/.vite/deps/chunk-MOFDO34C.js
|
||||
?? node_modules/.vite/deps/chunk-MOFDO34C.js.map
|
||||
?? node_modules/.vite/deps/react-helmet-async.js
|
||||
?? node_modules/.vite/deps/react-helmet-async.js.map
|
||||
?? node_modules/invariant/
|
||||
?? node_modules/react-fast-compare/
|
||||
?? node_modules/react-helmet-async/
|
||||
?? node_modules/shallowequal/
|
||||
?? public/version.json
|
||||
?? scripts/build-static-routes.sh
|
||||
?? src/components/SEO.tsx
|
||||
?? src/config/environment.ts
|
||||
|
||||
Status:
|
||||
Preparado para publicação
|
||||
|
||||
Commit:
|
||||
4e26c132
|
||||
|
||||
Arquivos no commit:
|
||||
.github/workflows/README-CI-CD.md
|
||||
.github/workflows/deploy.yml
|
||||
.gitignore
|
||||
DEPLOY-DOCKER.md
|
||||
GUIA-NGINX.md
|
||||
index.html
|
||||
infra/releases/2026-05-30_23-52-07_HML.md
|
||||
infra/releases/2026-05-30_23-54-46_HML.md
|
||||
nginx-docker.conf
|
||||
node_modules/.package-lock.json
|
||||
node_modules/.vite/deps/@radix-ui_react-dialog.js
|
||||
node_modules/.vite/deps/@radix-ui_react-radio-group.js
|
||||
node_modules/.vite/deps/@radix-ui_react-select.js
|
||||
node_modules/.vite/deps/_metadata.json
|
||||
node_modules/.vite/deps/chunk-INCCO7S4.js
|
||||
node_modules/.vite/deps/chunk-INCCO7S4.js.map
|
||||
node_modules/.vite/deps/chunk-L2OGOWTU.js
|
||||
node_modules/.vite/deps/chunk-L2OGOWTU.js.map
|
||||
node_modules/.vite/deps/chunk-LIWCVBQK.js
|
||||
node_modules/.vite/deps/chunk-LIWCVBQK.js.map
|
||||
node_modules/.vite/deps/chunk-MOFDO34C.js
|
||||
node_modules/.vite/deps/chunk-MOFDO34C.js.map
|
||||
node_modules/.vite/deps/react-helmet-async.js
|
||||
node_modules/.vite/deps/react-helmet-async.js.map
|
||||
node_modules/invariant/CHANGELOG.md
|
||||
node_modules/invariant/LICENSE
|
||||
node_modules/invariant/README.md
|
||||
node_modules/invariant/browser.js
|
||||
node_modules/invariant/invariant.js
|
||||
node_modules/invariant/invariant.js.flow
|
||||
node_modules/invariant/package.json
|
||||
node_modules/react-fast-compare/LICENSE
|
||||
node_modules/react-fast-compare/README.md
|
||||
node_modules/react-fast-compare/index.d.ts
|
||||
node_modules/react-fast-compare/index.js
|
||||
node_modules/react-fast-compare/package.json
|
||||
node_modules/react-helmet-async/LICENSE
|
||||
node_modules/react-helmet-async/README.md
|
||||
node_modules/react-helmet-async/lib/Dispatcher.d.ts
|
||||
node_modules/react-helmet-async/lib/HelmetData.d.ts
|
||||
node_modules/react-helmet-async/lib/Provider.d.ts
|
||||
node_modules/react-helmet-async/lib/React19Dispatcher.d.ts
|
||||
node_modules/react-helmet-async/lib/client.d.ts
|
||||
node_modules/react-helmet-async/lib/constants.d.ts
|
||||
node_modules/react-helmet-async/lib/index.d.ts
|
||||
node_modules/react-helmet-async/lib/index.esm.js
|
||||
node_modules/react-helmet-async/lib/index.js
|
||||
node_modules/react-helmet-async/lib/reactVersion.d.ts
|
||||
node_modules/react-helmet-async/lib/server.d.ts
|
||||
node_modules/react-helmet-async/lib/types.d.ts
|
||||
node_modules/react-helmet-async/lib/utils.d.ts
|
||||
node_modules/react-helmet-async/package.json
|
||||
node_modules/shallowequal/LICENSE
|
||||
node_modules/shallowequal/README.md
|
||||
node_modules/shallowequal/index.js
|
||||
node_modules/shallowequal/index.js.flow
|
||||
node_modules/shallowequal/index.original.js
|
||||
node_modules/shallowequal/package.json
|
||||
package-lock.json
|
||||
package.json
|
||||
public/robots.txt
|
||||
public/sitemap.xml
|
||||
public/version.json
|
||||
scripts/build-static-routes.sh
|
||||
scripts/dev.sh
|
||||
src/App.tsx
|
||||
src/components/HomologationBanner.tsx
|
||||
src/components/SEO.tsx
|
||||
src/config/environment.ts
|
||||
src/config/mautic.ts
|
||||
src/config/site.ts
|
||||
src/main.tsx
|
||||
src/pages/Blog.tsx
|
||||
src/pages/Cases.tsx
|
||||
src/pages/Condominios.tsx
|
||||
src/pages/Privacidade.tsx
|
||||
src/pages/Sobre.tsx
|
||||
src/pages/Tecnologias.tsx
|
||||
src/pages/Termos.tsx
|
||||
src/pages/nichos/Advocacia.tsx
|
||||
src/pages/nichos/BackupCorporativo.tsx
|
||||
src/pages/nichos/Contabilidade.tsx
|
||||
src/pages/nichos/FirewallPfSense.tsx
|
||||
src/pages/nichos/Monitoramento.tsx
|
||||
src/pages/nichos/VoipEmpresarial.tsx
|
||||
src/pages/services/Backup.tsx
|
||||
src/pages/services/CloudComputing.tsx
|
||||
src/pages/services/Consultoria.tsx
|
||||
src/pages/services/Noc.tsx
|
||||
src/pages/services/Pabx.tsx
|
||||
src/pages/services/Redes.tsx
|
||||
src/pages/services/Seguranca.tsx
|
||||
src/pages/services/Servidores.tsx
|
||||
src/pages/services/Suporte.tsx
|
||||
src/pages/services/TiGerenciada.tsx
|
||||
src/pages/tech/Cisco.tsx
|
||||
src/pages/tech/Linux.tsx
|
||||
src/pages/tech/PfSense.tsx
|
||||
src/pages/tech/Proxmox.tsx
|
||||
src/pages/tech/Sharepoint.tsx
|
||||
src/pages/tech/Vmware.tsx
|
||||
src/pages/tech/WindowsServer.tsx
|
||||
src/sections/Footer.tsx
|
||||
src/sections/Navigation.tsx
|
||||
vite.config.ts
|
||||
|
||||
Status final:
|
||||
Publicado no Gitea / aguardando pipeline HML
|
||||
@@ -0,0 +1,21 @@
|
||||
# Release HML
|
||||
|
||||
Data: dom 31 mai 2026 00:28:41 -03
|
||||
|
||||
Ambiente:
|
||||
HML
|
||||
|
||||
Descrição:
|
||||
Revisão Logo, Favicon, Robots
|
||||
|
||||
Branch:
|
||||
develop
|
||||
|
||||
Arquivos alterados antes do commit:
|
||||
D infra/releases/2026-05-30_23-54-46_HML.md
|
||||
?? .github/
|
||||
?? .gitignore
|
||||
?? infra/releases/2026-05-31_00-28-41_HML.md
|
||||
|
||||
Status:
|
||||
Preparado para publicação
|
||||
Reference in New Issue
Block a user