ajuste: runner com docker cli
Some checks failed
Deploy NestJS API / build-and-push-deploy (push) Failing after 26s

This commit is contained in:
2026-01-02 15:02:37 -05:00
parent 2d9336ff4d
commit 1e3ded80ed

View File

@@ -2,7 +2,7 @@ name: Deploy NestJS API
on: [push] on: [push]
jobs: jobs:
build-and-push: build-and-push-deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
@@ -14,10 +14,27 @@ jobs:
- name: Build e Push - name: Build e Push
run: | run: |
# Usando o ID do commit para versionamento (Rollback fácil) # Tag imutável para Rollback (SHA do Git)
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
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
uses: https://github.com/appleboy/ssh-action@master
with:
host: 172.35.0.216
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