From c7722c010c83f8c8235fb3e790f7b6cb5612e226 Mon Sep 17 00:00:00 2001 From: Sidney Date: Sun, 7 Jun 2026 18:09:31 -0300 Subject: [PATCH] ci: simplificar pipeline para build local sem tokens (paridade com EduManager) --- .gitea/workflows/deploy.yml | 47 ++++++++++--------------------------- docker-compose.yml | 4 ++-- 2 files changed, 14 insertions(+), 37 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index ddffbf8..5a550c0 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -6,46 +6,23 @@ on: workflow_dispatch: {} jobs: - build-and-push: + build-and-deploy: runs-on: self-hosted steps: - name: Checkout code uses: actions/checkout@v4 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Log in to Gitea Container Registry - uses: docker/login-action@v3 - with: - registry: gitea.microtecinformaticacurso.com.br - username: ${{ github.actor }} - password: ${{ secrets.GITEA_TOKEN }} - - - name: Build and push App - uses: docker/build-push-action@v5 - with: - context: . - push: true - platforms: linux/arm64 - tags: gitea.microtecinformaticacurso.com.br/${{ github.repository }}/agendapro-app:latest - - - name: Build and push Admin - uses: docker/build-push-action@v5 - with: - context: ./admin - push: true - platforms: linux/arm64 - tags: gitea.microtecinformaticacurso.com.br/${{ github.repository }}/agendapro-admin:latest - - - name: Atualizar Containers em Produção (Watchtower) + - name: Build App run: | - AUTH=$(echo -n "${{ github.actor }}:${{ secrets.GITEA_TOKEN }}" | base64 -w 0) - echo "{\"auths\": {\"gitea.microtecinformaticacurso.com.br\": {\"auth\": \"$AUTH\"}}}" > $(pwd)/registry-config.json + docker build --no-cache -t agendapro-app:local . - docker run --rm \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -v $(pwd)/registry-config.json:/config.json \ - containrrr/watchtower \ - --run-once --cleanup --debug + - name: Build Admin + run: | + cd admin + docker build --no-cache -t agendapro-admin:local . + + - name: Deploy to Portainer + run: | + docker service update --force --image agendapro-app:local agendapro_agendapro || echo "App ainda não existe, será criado pelo stack deploy inicial." + docker service update --force --image agendapro-admin:local agendapro_admin-agendapro || echo "Admin ainda não existe, será criado pelo stack deploy inicial." diff --git a/docker-compose.yml b/docker-compose.yml index bcf8e8b..ecdbb17 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,7 +27,7 @@ services: # AGENDAPRO APP — Sistema Principal # ============================================================= agendapro: - image: gitea.microtecinformaticacurso.com.br/sidney/agendapro/agendapro-app:latest + image: agendapro-app:local restart: always depends_on: - postgres-agendapro @@ -53,7 +53,7 @@ services: # ADMIN PANEL — Gerenciador de Assinaturas # ============================================================= admin-agendapro: - image: gitea.microtecinformaticacurso.com.br/sidney/agendapro/agendapro-admin:latest + image: agendapro-admin:local restart: always depends_on: - postgres-agendapro