All checks were successful
Build (develop) / Promote (main) / build-and-push-deploy (push) Successful in 1m25s
32 lines
925 B
YAML
32 lines
925 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: Push to Gitea Registry
|
|
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)
|
|
|
|
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"
|