diff --git a/.gitea/workflows/deploy-api.yaml b/.gitea/workflows/deploy-api.yaml index bc0644d..4c42c15 100644 --- a/.gitea/workflows/deploy-api.yaml +++ b/.gitea/workflows/deploy-api.yaml @@ -12,20 +12,18 @@ jobs: with: fetch-depth: 0 - - name: Push to Gitea Registry + - name: Build and Push run: | - # 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) + # Forçamos o caminho completo em minúsculas + IMAGE_NAME="$REGISTRY/simplifique/vendaweb-api" + SHA_TAG=$(echo ${{ gitea.sha }} | cut -c1-7) 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" . + # Build com ambas as tags + docker build -t "$IMAGE_NAME:$SHA_TAG" -t "$IMAGE_NAME:latest" . - # Push de ambas as tags - docker push "$IMAGE_LOWER:latest" - docker push "$IMAGE_LOWER:$TAG" + # Push de ambas para garantir que o 'latest' exista no registro + docker push "$IMAGE_NAME:$SHA_TAG" + docker push "$IMAGE_NAME:latest"