refactor: Update workflow name, SHA source, Docker image tagging, and Portainer webhook notification.
Deploy NestJS API / build-and-push-deploy (push) Successful in 30s Details

This commit is contained in:
joelson 2026-01-05 15:23:32 -03:00
parent 1fa2938128
commit 9176d65606
1 changed files with 8 additions and 15 deletions

View File

@ -1,4 +1,4 @@
name: Deploy vendaweb-api name: Deploy NestJS API
on: [push] on: [push]
jobs: jobs:
@ -14,21 +14,14 @@ jobs:
- name: Build e Push - name: Build e Push
run: | run: |
# Usamos o SHA do commit para gerar uma tag única além da latest TAG=${{ gitea.sha }}
TAG=${{ github.sha }} docker build -t 10.1.1.124:8082/library/vendaweb-api:$TAG .
IMAGE_NAME=10.1.1.124:8082/library/vendaweb-api docker tag 10.1.1.124:8082/library/vendaweb-api:$TAG 10.1.1.124:8082/library/vendaweb-api:latest
docker build -t $IMAGE_NAME:$TAG -t $IMAGE_NAME:latest . docker push 10.1.1.124:8082/library/vendaweb-api:$TAG
docker push 10.1.1.124:8082/library/vendaweb-api:latest
docker push $IMAGE_NAME:$TAG
docker push $IMAGE_NAME:latest
- name: Notificar Portainer via Webhook - name: Notificar Portainer via Webhook
env:
7 WEBHOOK_URL: ${{ secrets.PORTAINER_WEBHOOK_VENDAWEBAPI }}
run: | run: |
if [ -z "$WEBHOOK_URL" ]; then # O Webhook avisa o Portainer para puxar a nova imagem imediatamente
echo "Erro: Secret PORTAINER_WEBHOOK_VENDAWEBAPI não configurado!" curl -X POST "${{ secrets.PORTAINER_WEBHOOK_VENDAWEBAPI }}"
exit 1
fi
curl -X POST "$WEBHOOK_URL"