first
Some checks failed
Deploy NestJS API / build-and-push-deploy (push) Failing after 19s

This commit is contained in:
2026-01-02 18:31:38 -05:00
parent 395c6de2c6
commit 7a9a40e859
6 changed files with 96 additions and 39 deletions

View File

@@ -0,0 +1,28 @@
name: Deploy NestJS API
on: [push]
jobs:
build-and-push-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login no Harbor
run: |
echo "${{ secrets.HARBOR_PASSWORD }}" | docker login 172.35.0.216 -u ${{ secrets.HARBOR_USERNAME }} --password-stdin
- name: Build e Push
run: |
# Usando o SHA do commit para manter o histórico no Harbor
TAG=${{ gitea.sha }}
docker build -t 172.35.0.216/library/vendaweb-api:$TAG .
docker tag 172.35.0.216/library/vendaweb-api:$TAG 172.35.0.216/library/vendaweb-api:latest
docker push 172.35.0.216/library/vendaweb-api:$TAG
docker push 172.35.0.216/library/vendaweb-api:latest
- name: Notificar Portainer via Webhook
run: |
# O Webhook avisa o Portainer para puxar a nova imagem imediatamente
curl -X POST "${{ secrets.PORTAINER_WEBHOOK_URL }}"

View File

@@ -0,0 +1,7 @@
O Rollback via Git (Mais Seguro)
No Gitea, faça um git revert no commit que deu erro.
Dê o git push.
O Portainer detectará a mudança e atualizará o serviço para a versão estável de forma oficial.