Files
Vendaweb-api/.gitea/workflows/deploy-api.yaml
Joelbrit0 0c09ee795e
All checks were successful
Build (develop) / Promote (main) / build-and-push-deploy (push) Successful in 1m24s
feat: migrate registry to gitea and simplify workflow
2026-01-29 14:23:24 -03:00

30 lines
896 B
YAML

name: Build (develop) / Promote (main)
on:
push:
branches: [main, develop, homolog]
jobs:
build-and-push-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build and Push
run: |
REGISTRY="git.simplifiquehc.com.br"
# 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 com ambas as tags
docker build -t "$IMAGE_NAME:$SHA_TAG" -t "$IMAGE_NAME:latest" .
# Push de ambas para garantir que o 'latest' exista no registro
docker push "$IMAGE_NAME:$SHA_TAG"
docker push "$IMAGE_NAME:latest"