From f54c03ee294604d062f35f0650d6dea176579bcb Mon Sep 17 00:00:00 2001 From: simplifique Date: Fri, 2 Jan 2026 16:04:56 -0500 Subject: [PATCH] feat: atualizando mensagem de webhook --- .gitea/workflows/deploy-api.yaml | 26 +++++++++++++++++--------- src/app.service.ts | 2 +- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/deploy-api.yaml b/.gitea/workflows/deploy-api.yaml index c00aea6..24e9175 100644 --- a/.gitea/workflows/deploy-api.yaml +++ b/.gitea/workflows/deploy-api.yaml @@ -14,6 +14,7 @@ jobs: - name: Build e Push run: | + # Tag imutável para Rollback (SHA do Git) TAG=${{ gitea.sha }} docker build -t 172.35.0.216/library/api-teste:$TAG . docker tag 172.35.0.216/library/api-teste:$TAG 172.35.0.216/library/api-teste:latest @@ -21,12 +22,19 @@ jobs: docker push 172.35.0.216/library/api-teste:$TAG docker push 172.35.0.216/library/api-teste:latest - - name: Deploy - run: | - sleep 10 - curl -X POST http://172.35.0.216:9000/api/webhooks/182007f4-06d9-48fc-ab68-885fb434765c - - # LEGADO Deploy via SSH (Mantenha se precisar rodar comandos extras como migrations) - # - name: Deploy Automático via SSH - # uses: https://github.com/appleboy/ssh-action@master - # ... \ No newline at end of file + - name: Deploy Automático via SSH + uses: https://github.com/appleboy/ssh-action@master + with: + host: 172.35.0.216 + username: root + key: ${{ secrets.SSH_PRIVATE_KEY }} + script: | + docker service update \ + --image 172.35.0.216/library/api-teste:latest \ + --with-registry-auth \ + api_teste_service || \ + docker service create \ + --name api_teste_service \ + --publish 3001:3000 \ + --with-registry-auth \ + 172.35.0.216/library/api-teste:latest \ No newline at end of file diff --git a/src/app.service.ts b/src/app.service.ts index 4c79c04..82a2ef2 100644 --- a/src/app.service.ts +++ b/src/app.service.ts @@ -3,6 +3,6 @@ import { Injectable } from '@nestjs/common'; @Injectable() export class AppService { getHello(): string { - return 'Hello World! webhook'; + return 'Hello World! ssh'; } }