From 09396e334d3673bd47c5ff661321b74f4d4df20b Mon Sep 17 00:00:00 2001 From: Joelbrit0 Date: Thu, 29 Jan 2026 14:20:09 -0300 Subject: [PATCH] feat: migrate registry to gitea and simplify workflow --- .gitea/workflows/deploy-api.yaml | 26 +++++++++---------- .../prod/deployment-image-digest-patch.yaml | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.gitea/workflows/deploy-api.yaml b/.gitea/workflows/deploy-api.yaml index 4a14a80..bc0644d 100644 --- a/.gitea/workflows/deploy-api.yaml +++ b/.gitea/workflows/deploy-api.yaml @@ -14,18 +14,18 @@ jobs: - name: Push to Gitea Registry run: | - # Define Image Name (removes https:// and converts to lowercase) - IMAGE="git.simplifiquehc.com.br/${{ gitea.repository }}" - IMAGE_LOWER=$(echo "$IMAGE" | tr '[:upper:]' '[:lower:]') - - # Login to Gitea Registry (using the domain) - echo "${{ secrets.K8S }}" | docker login git.simplifiquehc.com.br -u "${{ gitea.actor }}" --password-stdin - - # Build and Push - docker build -t "$IMAGE_LOWER:latest" . - docker push "$IMAGE_LOWER:latest" - - # Optional: Use SHA tag as well + # Use variáveis fixas para evitar erros de interpolação + REGISTRY="git.simplifiquehc.com.br" + OWNER="simplifique" + REPO="vendaweb-api" + IMAGE_LOWER="$REGISTRY/$OWNER/$REPO" TAG=$(echo ${{ gitea.sha }} | cut -c1-7) - docker tag "$IMAGE_LOWER:latest" "$IMAGE_LOWER:$TAG" + + echo "${{ secrets.K8S }}" | docker login "$REGISTRY" -u "${{ gitea.actor }}" --password-stdin + + # Build forçando o nome correto + docker build -t "$IMAGE_LOWER:latest" -t "$IMAGE_LOWER:$TAG" . + + # Push de ambas as tags + docker push "$IMAGE_LOWER:latest" docker push "$IMAGE_LOWER:$TAG" diff --git a/k8s/overlays/prod/deployment-image-digest-patch.yaml b/k8s/overlays/prod/deployment-image-digest-patch.yaml index a8a5e4b..29d1607 100644 --- a/k8s/overlays/prod/deployment-image-digest-patch.yaml +++ b/k8s/overlays/prod/deployment-image-digest-patch.yaml @@ -7,4 +7,4 @@ spec: spec: containers: - name: api - image: 172.35.0.216/library/vendaweb-api@sha256:aac490fcb4ef7baa95f1df01fa50d2d44bdb4ed12b235e5dd89e1d7dc3cd0a3a + image: git.simplifiquehc.com.br/simplifique/vendaweb-api:latest