diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..7b0fef1 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,40 @@ +name: Deploy CI + +on: + push: + branches: [ master ] + workflow_dispatch: + +jobs: + deploy: + runs-on: deploy + container: + image: alpine:latest + + steps: + - name: Checkout + run: | + apk add --no-cache git bash + git clone http://10.11.10.71:3000/${{ gitea.repository }}.git . + git checkout ${{ gitea.sha }} + + - name: Validar scripts shell + run: | + echo "🔍 Validando sintaxe dos scripts..." + for script in scripts/*.sh; do + if [ -f "$script" ]; then + echo "✅ Validando $script..." + bash -n "$script" + fi + done + + - name: Executar verificações pós-deploy + run: | + echo "🔧 Executando verificações pós-deploy..." + chmod +x scripts/*.sh + ./scripts/ping_monitor.sh + ./scripts/ram-monitor.sh + ./scripts/disk-monitor.sh + + - name: Concluir deploy + run: echo "✅ Deploy concluído com sucesso!" \ No newline at end of file