fix: harden GitOps deploy and rollback
All checks were successful
Build (develop) / Promote (main) / build-and-push-deploy (push) Successful in 1m22s

This commit is contained in:
2026-01-29 15:21:07 -03:00
parent ecd298442b
commit fd17be5408
7 changed files with 45 additions and 15 deletions

View File

@@ -24,16 +24,18 @@ jobs:
docker push "$IMAGE_NAME:$SHA_TAG"
docker push "$IMAGE_NAME:latest"
- name: Update Kubernetes Manifest
- name: Update Manifest and Push to Git
run: |
SHA_TAG=$(echo ${{ gitea.sha }} | cut -c1-7)
IMAGE_NAME="git.simplifiquehc.com.br/simplifique/vendaweb-api"
sed -i "s|image: $IMAGE_NAME:.*|image: $IMAGE_NAME:$SHA_TAG|g" k8s/base/deployment.yaml
MANIFEST_FILE="k8s/overlays/prod/deployment-image-digest-patch.yaml"
git config --global user.name "Gitea Action"
git config --global user.email "actions@simplifiquehc.com.br"
sed -i "s|image: $IMAGE_NAME:.*|image: $IMAGE_NAME:$SHA_TAG|g" "$MANIFEST_FILE"
git add k8s/base/deployment.yaml
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