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
|
- name: Push to Gitea Registry
|
||||||
run: |
|
run: |
|
||||||
# Define Image Name (removes https:// and converts to lowercase)
|
# Use variáveis fixas para evitar erros de interpolação
|
||||||
IMAGE="git.simplifiquehc.com.br/${{ gitea.repository }}"
|
REGISTRY="git.simplifiquehc.com.br"
|
||||||
IMAGE_LOWER=$(echo "$IMAGE" | tr '[:upper:]' '[:lower:]')
|
OWNER="simplifique"
|
||||||
|
REPO="vendaweb-api"
|
||||||
# Login to Gitea Registry (using the domain)
|
IMAGE_LOWER="$REGISTRY/$OWNER/$REPO"
|
||||||
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
|
|
||||||
TAG=$(echo ${{ gitea.sha }} | cut -c1-7)
|
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"
|
docker push "$IMAGE_LOWER:$TAG"
|
||||||
|
|||||||
@@ -7,4 +7,4 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: api
|
- 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