feat: migrate registry to gitea and simplify workflow
All checks were successful
Build (develop) / Promote (main) / build-and-push-deploy (push) Successful in 1m24s
All checks were successful
Build (develop) / Promote (main) / build-and-push-deploy (push) Successful in 1m24s
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user