diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 94195e5..9cedb08 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -15,7 +15,7 @@ jobs: - name: Build and Push run: | set -euo pipefail - REGISTRY="git.simplifiquehc.com.br" + REGISTRY="172.35.0.216:3000" IMAGE_NAME="$REGISTRY/simplifique/vendaweb-portal" SHA_TAG=$(echo "${{ github.sha }}" | cut -c1-7) @@ -45,22 +45,26 @@ jobs: run: | set -euo pipefail SHA_TAG=$(echo "${{ github.sha }}" | cut -c1-7) - IMAGE_NAME="git.simplifiquehc.com.br/simplifique/vendaweb-portal" MANIFEST_FILE="k8s/overlays/prod/deployment-image-digest-patch.yaml" - sed -i -E "s|^([[:space:]]*image: ${IMAGE_NAME}:).*|\\1${SHA_TAG}|g" "$MANIFEST_FILE" + # Match image line for vendaweb-portal and replace tag (works with any registry hostname) + sed -i -E "s|(image: .*vendaweb-portal:).*|\1${SHA_TAG}|" "$MANIFEST_FILE" if [ -z "${{ secrets.GITEA_TOKEN }}" ]; then echo "Missing secrets.GITEA_TOKEN (needed to push back to repo)" exit 1 fi - git remote set-url origin "https://${{ github.actor }}:${{ secrets.GITEA_TOKEN }}@git.simplifiquehc.com.br/simplifique/Vendaweb-portal.git" + git remote set-url origin "http://${{ github.actor }}:${{ secrets.GITEA_TOKEN }}@172.35.0.216:3000/simplifique/Vendaweb-portal.git" 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 + if git diff --staged --quiet; then + echo "Manifest already has image tag $SHA_TAG, nothing to commit" + else + git commit -m "chore: update image tag to $SHA_TAG [skip ci]" + git push origin main + fi diff --git a/k8s/base/deployment.yaml b/k8s/base/deployment.yaml index 6577170..fe1953a 100644 --- a/k8s/base/deployment.yaml +++ b/k8s/base/deployment.yaml @@ -27,7 +27,7 @@ spec: terminationGracePeriodSeconds: 30 containers: - name: portal - image: git.simplifiquehc.com.br/simplifique/vendaweb-portal:latest + image: 172.35.0.216:3000/simplifique/vendaweb-portal:latest imagePullPolicy: IfNotPresent ports: - name: http diff --git a/k8s/overlays/prod/deployment-image-digest-patch.yaml b/k8s/overlays/prod/deployment-image-digest-patch.yaml index c7438f5..d5bcf45 100644 --- a/k8s/overlays/prod/deployment-image-digest-patch.yaml +++ b/k8s/overlays/prod/deployment-image-digest-patch.yaml @@ -7,4 +7,4 @@ spec: spec: containers: - name: portal - image: git.simplifiquehc.com.br/simplifique/vendaweb-portal:d7edd99 + image: 172.35.0.216:3000/simplifique/vendaweb-portal:161ed4d diff --git a/src/index.html b/src/index.html index 1fbab3c..ce467af 100644 --- a/src/index.html +++ b/src/index.html @@ -38,7 +38,7 @@ -