Atualizar .gitea/workflows/build.yaml
Some checks failed
Build e Deploy Direto / build-and-deploy (push) Failing after 4s
Some checks failed
Build e Deploy Direto / build-and-deploy (push) Failing after 4s
This commit is contained in:
@@ -1,28 +1,30 @@
|
|||||||
name: CI/CD Pipeline Coolify
|
name: Build e Deploy Direto
|
||||||
run-name: Pipeline executada por ${{ gitea.actor }} 🚀
|
run-name: Build & Deploy por ${{ gitea.actor }} 🚀
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "main", "master" ]
|
branches: [ "main", "master" ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
testes:
|
build-and-deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
|
||||||
image: maven:3.9.6-eclipse-temurin-21 # Imagem oficial com tudo pronto
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout do código
|
- name: Checkout do código
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Rodar Testes com Maven
|
- name: Configurar JDK 21
|
||||||
run: mvn -B test # Aqui o 'mvn' já vai funcionar direto
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
java-version: '21'
|
||||||
|
distribution: 'temurin'
|
||||||
|
|
||||||
# Job 2: Trigger da API (Só roda se os testes passarem)
|
- name: Build do JAR (Sem Testes)
|
||||||
deploy-trigger:
|
run: |
|
||||||
needs: testes
|
# O -DskipTests ignora os testes e foca só em gerar o arquivo
|
||||||
runs-on: ubuntu-latest
|
chmod +x mvnw
|
||||||
steps:
|
./mvnw clean package -DskipTests
|
||||||
- name: Disparar Deploy no Coolify
|
|
||||||
|
- name: Chamar Webhook do Coolify
|
||||||
run: |
|
run: |
|
||||||
curl -X GET "https://coolify.stackpanel.com.br/api/v1/deploy?uuid=iwwcg08c04css0o444k08sgg&force=false" \
|
curl -X GET "https://coolify.stackpanel.com.br/api/v1/deploy?uuid=iwwcg08c04css0o444k08sgg&force=false" \
|
||||||
-H "Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}"
|
-H "Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}"
|
||||||
Reference in New Issue
Block a user