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:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Push to Gitea Registry
|
- name: Build and Push
|
||||||
run: |
|
run: |
|
||||||
# Use variáveis fixas para evitar erros de interpolação
|
|
||||||
REGISTRY="git.simplifiquehc.com.br"
|
REGISTRY="git.simplifiquehc.com.br"
|
||||||
OWNER="simplifique"
|
# Forçamos o caminho completo em minúsculas
|
||||||
REPO="vendaweb-api"
|
IMAGE_NAME="$REGISTRY/simplifique/vendaweb-api"
|
||||||
IMAGE_LOWER="$REGISTRY/$OWNER/$REPO"
|
SHA_TAG=$(echo ${{ gitea.sha }} | cut -c1-7)
|
||||||
TAG=$(echo ${{ gitea.sha }} | cut -c1-7)
|
|
||||||
|
|
||||||
echo "${{ secrets.K8S }}" | docker login "$REGISTRY" -u "${{ gitea.actor }}" --password-stdin
|
echo "${{ secrets.K8S }}" | docker login "$REGISTRY" -u "${{ gitea.actor }}" --password-stdin
|
||||||
|
|
||||||
# Build forçando o nome correto
|
# Build com ambas as tags
|
||||||
docker build -t "$IMAGE_LOWER:latest" -t "$IMAGE_LOWER:$TAG" .
|
docker build -t "$IMAGE_NAME:$SHA_TAG" -t "$IMAGE_NAME:latest" .
|
||||||
|
|
||||||
# Push de ambas as tags
|
# Push de ambas para garantir que o 'latest' exista no registro
|
||||||
docker push "$IMAGE_LOWER:latest"
|
docker push "$IMAGE_NAME:$SHA_TAG"
|
||||||
docker push "$IMAGE_LOWER:$TAG"
|
docker push "$IMAGE_NAME:latest"
|
||||||
|
|||||||
Reference in New Issue
Block a user