From b0a51912391e10e2024163b26de12b2eb93aa7db Mon Sep 17 00:00:00 2001 From: carloshra Date: Thu, 26 Feb 2026 23:02:45 +0000 Subject: [PATCH] Build atualizado so para testes --- .gitea/workflows/build.yaml | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index c7ebf7e..691842d 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -1,20 +1,36 @@ -name: Gitea Actions Java Build -run-name: ${{ gitea.actor }} está buildando o coolify-back 🚀 -on: [push] +name: CI/CD Pipeline Coolify +run-name: Pipeline executada por ${{ gitea.actor }} 🚀 + +on: + push: + branches: [ "main", "master" ] jobs: - build-projeto: - runs-on: ubuntu-latest # Ou o label que você definiu no seu runner + # Job 1: Testes de Unidade + testes: + runs-on: ubuntu-latest steps: - name: Checkout do código uses: actions/checkout@v4 - - name: Configurar Java JDK + - name: Configurar JDK 17 uses: actions/setup-java@v4 with: - java-version: '21' + java-version: '17' distribution: 'temurin' cache: 'maven' - - name: Build com Maven - run: mvn -B package --file pom.xml \ No newline at end of file + - name: Rodar Testes com Maven + run: mvn test + + # Job 2: Trigger da API (Só roda se os testes passarem) + deploy-trigger: + needs: testes + runs-on: ubuntu-latest + steps: + - name: Chamar API de Build Automático + run: | + curl -X POST "${{ secrets.API_URL }}" \ + -H "Authorization: Bearer ${{ secrets.MINHA_API_TOKEN }}" \ + -H "Content-Type: application/json" \ + -d '{"repo": "coolify-back", "status": "testing_passed"}' \ No newline at end of file