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