7 Commits

Author SHA1 Message Date
admin 25d18686e4 Atualizar .github/workflows/teste-shell.yml
Deploy via Script Externo / deploy (push) Waiting to run
ShellCheck CI / shellcheck (push) Waiting to run
Teste Shell Runner / shell-test (push) Successful in 5s
2026-05-30 04:18:34 +00:00
admin 9362771f7c Atualizar .github/workflows/teste-shell.yml
Deploy via Script Externo / deploy (push) Waiting to run
ShellCheck CI / shellcheck (push) Waiting to run
Teste Shell Runner / shell-test (push) Failing after 0s
2026-05-30 04:01:19 +00:00
admin ba7d7066c0 Atualizar .github/workflows/teste-shell.yml
Deploy via Script Externo / deploy (push) Waiting to run
ShellCheck CI / shellcheck (push) Waiting to run
Teste Shell Runner / shell-test (push) Waiting to run
2026-05-30 03:52:37 +00:00
admin eca0284dac Atualizar .github/workflows/teste-shell.yml
Deploy via Script Externo / deploy (push) Waiting to run
ShellCheck CI / shellcheck (push) Waiting to run
Teste Shell Runner / shell-test (push) Waiting to run
2026-05-30 03:49:14 +00:00
admin 153f48a394 Adicionar .github/workflows/teste-shell.yml
Deploy via Script Externo / deploy (push) Waiting to run
ShellCheck CI / shellcheck (push) Waiting to run
2026-05-30 03:48:59 +00:00
admin fe367f4b04 fix: substituido _ po - no nome script ram e disk 2026-05-19 02:52:39 +00:00
admin dc36dd2eef feat: adicionado if then 2026-05-19 02:38:08 +00:00
6 changed files with 137 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
name: Deploy via Script Externo
on:
push:
branches: [ main ]
workflow_dispatch: # Permite executar manualmente
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: 📥 Baixar código
uses: actions/checkout@v4
- name: 🔧 Configurar permissões
run: chmod +x scripts/*.sh
- name: 🚀 Executar deploy
run: ./scripts/deploy.sh
env:
DEPLOY_ENV: production
TIMESTAMP: $(date +%s)
+19
View File
@@ -0,0 +1,19 @@
name: ShellCheck CI
on:
push:
branches: [ main, feature/* ]
pull_request:
branches: [ main ]
jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
severity: warning
ignore_paths: logs
+63
View File
@@ -0,0 +1,63 @@
name: Teste Shell Runner
on:
push:
branches:
- main
jobs:
shell-test:
runs-on: deploy
steps:
- name: ✅ Verificar sistema
run: |
echo "=== Runner funcionando! ==="
echo "Data: $(date)"
echo "Hostname: $(hostname)"
uname -a
- name: 📦 Verificar ferramentas disponíveis
run: |
echo "=== Sistema base ==="
cat /etc/os-release
echo ""
echo "=== Ferramentas disponíveis ==="
which bash && bash --version | head -1
which curl && curl --version | head -1
which wget && wget --version 2>&1 | head -1 || echo "wget: não instalado"
which git && git --version
- name: 📦 Instalar python3 se necessário
run: |
# Alpine usa apk, Ubuntu/Debian usa apt
if command -v apk &>/dev/null; then
apk add --no-cache python3
elif command -v apt-get &>/dev/null; then
apt-get update -qq && apt-get install -y -qq python3
fi
python3 --version
- name: 🌐 Testar conectividade externa
run: |
echo "=== Ping externo ==="
curl -s https://ifconfig.me && echo ""
echo "Conectividade OK!"
- name: 📝 Criar e executar script shell inline
run: |
cat > /tmp/meu-script.sh << 'EOF'
#!/bin/bash
echo "=== Script a correr dentro do runner ==="
echo "Utilizador: $(whoami)"
echo "Directório: $(pwd)"
echo "Memória disponível:"
free -h
echo "Espaço em disco:"
df -h /
EOF
chmod +x /tmp/meu-script.sh
bash /tmp/meu-script.sh
- name: 🎉 Teste concluído
run: echo "Todos os steps passaram com sucesso!"
Binary file not shown.
+25
View File
@@ -0,0 +1,25 @@
#!/bin/bash
# Script de deploy executado pelo GitHub Actions
echo "🚀 Iniciando deploy automático..."
echo "📦 Deploy ID: $(date +%Y%m%d-%H%M%S)"
# Verificar scripts
for script in scripts/*.sh; do
if [ -f "$script" ]; then
echo "✅ Validando $script..."
bash -n "$script" # Syntax check
fi
done
# Simular deploy
echo "📂 Criando backup..."
mkdir -p backups
tar -czf "backups/backup-$(date +%Y%m%d).tar.gz" scripts/
echo "🔧 Executando verificações pós-deploy..."
./scripts/ping_monitor.sh
./scripts/ram-monitor.sh
./scripts/disk-monitor.sh
echo "✅ Deploy concluído com sucesso!"
+7
View File
@@ -1,4 +1,11 @@
#!/bin/bash #!/bin/bash
HOST="8.8.8.8" HOST="8.8.8.8"
echo "Testando conectividade..." echo "Testando conectividade..."
echo "🌐 Testando conectividade com $HOST..."
ping -c 4 $HOST ping -c 4 $HOST
if [ $? -eq 0 ]; then
echo "✅ Conexão OK"
else
echo "❌ Falha na conexão"
exit 1
fi