ajuste webhook
All checks were successful
Deploy NestJS API / build-and-push-deploy (push) Successful in 24s
All checks were successful
Deploy NestJS API / build-and-push-deploy (push) Successful in 24s
This commit is contained in:
@@ -14,7 +14,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build e Push
|
- name: Build e Push
|
||||||
run: |
|
run: |
|
||||||
# Tag imutável para Rollback (SHA do Git)
|
# Usando o SHA do commit para manter o histórico no Harbor
|
||||||
TAG=${{ gitea.sha }}
|
TAG=${{ gitea.sha }}
|
||||||
docker build -t 172.35.0.216/library/api-teste:$TAG .
|
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
|
docker tag 172.35.0.216/library/api-teste:$TAG 172.35.0.216/library/api-teste:latest
|
||||||
@@ -22,19 +22,7 @@ jobs:
|
|||||||
docker push 172.35.0.216/library/api-teste:$TAG
|
docker push 172.35.0.216/library/api-teste:$TAG
|
||||||
docker push 172.35.0.216/library/api-teste:latest
|
docker push 172.35.0.216/library/api-teste:latest
|
||||||
|
|
||||||
- name: Deploy Automático via SSH
|
- name: Notificar Portainer via Webhook
|
||||||
uses: https://github.com/appleboy/ssh-action@master
|
run: |
|
||||||
with:
|
# O Webhook avisa o Portainer para puxar a nova imagem imediatamente
|
||||||
host: 172.35.0.216
|
curl -X POST "${{ secrets.PORTAINER_WEBHOOK_URL }}"
|
||||||
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
|
|
||||||
Reference in New Issue
Block a user