Files
Vendaweb-api/.gitea/workflows/deploy-api.yaml
simplifique c088c38a05
All checks were successful
Build (develop) / Promote (main) / build-and-push-deploy (push) Successful in 1m38s
chore: update registry and repository URLs to use internal IP address
2026-02-12 18:08:05 -03:00

42 lines
1.3 KiB
YAML

name: Build (develop) / Promote (main)
on:
push:
branches: [main]
jobs:
build-and-push-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build and Push
run: |
REGISTRY="172.35.0.216:3000"
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
docker build -t "$IMAGE_NAME:$SHA_TAG" -t "$IMAGE_NAME:latest" .
docker push "$IMAGE_NAME:$SHA_TAG"
docker push "$IMAGE_NAME:latest"
- name: Update Manifest and Push to Git
run: |
SHA_TAG=$(echo ${{ gitea.sha }} | cut -c1-7)
IMAGE_NAME="172.35.0.216:3000/simplifique/vendaweb-api"
MANIFEST_FILE="k8s/overlays/prod/deployment-image-digest-patch.yaml"
sed -i "s|image: $IMAGE_NAME:.*|image: $IMAGE_NAME:$SHA_TAG|g" "$MANIFEST_FILE"
git config user.name "Gitea Action"
git config user.email "actions@simplifiquehc.com.br"
git add "$MANIFEST_FILE"
git commit -m "chore: update image tag to $SHA_TAG [skip ci]"
git push origin main