refactor: simplify image tagging and pushing in deployment workflow
Deploy NestJS API / build-and-push-deploy (push) Successful in 2m8s
Details
Deploy NestJS API / build-and-push-deploy (push) Successful in 2m8s
Details
This commit is contained in:
parent
217329adef
commit
70e88913f5
|
|
@ -14,14 +14,17 @@ jobs:
|
|||
|
||||
- name: Build e Push
|
||||
run: |
|
||||
TAG=${{ gitea.sha }}
|
||||
docker build -t 10.1.1.124:8082/library/vendaweb-api:$TAG .
|
||||
docker tag 10.1.1.124:8082/library/vendaweb-api:$TAG 10.1.1.124:8082/library/vendaweb-api:latest
|
||||
# Usando o short SHA para uma tag mais limpa
|
||||
TAG=$(echo ${{ gitea.sha }} | cut -c1-7)
|
||||
IMAGE_NAME="10.1.1.124:8082/library/vendaweb-api"
|
||||
|
||||
docker push 10.1.1.124:8082/library/vendaweb-api:$TAG
|
||||
docker push 10.1.1.124:8082/library/vendaweb-api:latest
|
||||
docker build -t $IMAGE_NAME:$TAG .
|
||||
docker tag $IMAGE_NAME:$TAG $IMAGE_NAME:latest
|
||||
|
||||
docker push $IMAGE_NAME:$TAG
|
||||
docker push $IMAGE_NAME:latest
|
||||
|
||||
- name: Notificar Portainer via Webhook
|
||||
run: |
|
||||
# O Webhook avisa o Portainer para puxar a nova imagem imediatamente
|
||||
curl -X POST "${{ secrets.PORTAINER_WEBHOOK_VENDAWEBAPI }}"
|
||||
# O segredo PORTAINER_WEBHOOK_VENDAWEBAPI deve conter a URL completa gerada na Stack
|
||||
curl -f -X POST "${{ secrets.PORTAINER_WEBHOOK_VENDAWEBAPI }}"
|
||||
Loading…
Reference in New Issue