refactor: simplify image tagging and pushing in deployment workflow
Deploy NestJS API / build-and-push-deploy (push) Successful in 2m8s Details

This commit is contained in:
joelson 2026-01-06 12:23:33 -03:00
parent 217329adef
commit 70e88913f5
1 changed files with 10 additions and 7 deletions

View File

@ -14,14 +14,17 @@ jobs:
- name: Build e Push - name: Build e Push
run: | run: |
TAG=${{ gitea.sha }} # Usando o short SHA para uma tag mais limpa
docker build -t 10.1.1.124:8082/library/vendaweb-api:$TAG . TAG=$(echo ${{ gitea.sha }} | cut -c1-7)
docker tag 10.1.1.124:8082/library/vendaweb-api:$TAG 10.1.1.124:8082/library/vendaweb-api:latest IMAGE_NAME="10.1.1.124:8082/library/vendaweb-api"
docker push 10.1.1.124:8082/library/vendaweb-api:$TAG docker build -t $IMAGE_NAME:$TAG .
docker push 10.1.1.124:8082/library/vendaweb-api:latest docker tag $IMAGE_NAME:$TAG $IMAGE_NAME:latest
docker push $IMAGE_NAME:$TAG
docker push $IMAGE_NAME:latest
- name: Notificar Portainer via Webhook - name: Notificar Portainer via Webhook
run: | run: |
# O Webhook avisa o Portainer para puxar a nova imagem imediatamente # O segredo PORTAINER_WEBHOOK_VENDAWEBAPI deve conter a URL completa gerada na Stack
curl -X POST "${{ secrets.PORTAINER_WEBHOOK_VENDAWEBAPI }}" curl -f -X POST "${{ secrets.PORTAINER_WEBHOOK_VENDAWEBAPI }}"