ci: revert to simple commit-back (same as demo-frontend)
Some checks failed
Build & Deploy Go API / build (push) Failing after 4s

This commit is contained in:
Joe
2026-07-19 20:50:41 +08:00
parent da787921dc
commit 8071f8aa92

View File

@@ -44,25 +44,22 @@ jobs:
- name: Update image tag in values.yaml (commit-back GitOps)
run: |
set -ex
set -e
WORK=/root/.cache/demo-go-api
cd $WORK
SHORT=${GITHUB_SHA::8}
echo "=== Updating tag to ${SHORT} ==="
pwd
ls -la
cat deploy/helm/values.yaml
git status
git remote -v
# Update tag in values.yaml
echo "Updating tag to ${SHORT}"
sed -i "s/^ tag:.*/ tag: \"${SHORT}\"/" deploy/helm/values.yaml
echo "--- after sed ---"
cat deploy/helm/values.yaml
echo "--- diff ---"
git diff deploy/helm/values.yaml || true
git config user.email "ci@local"
git config user.name "gitea-ci"
git remote set-url origin "http://joe:${GITEA_TOKEN}@192.168.1.212:3000/joe/demo-go-api.git"
if git diff --quiet deploy/helm/values.yaml; then
echo "No changes to commit"
exit 0
fi
git add deploy/helm/values.yaml
git commit -m "ci: update image tag to ${SHORT}" || echo "nothing to commit"
git commit -m "ci: update image tag to ${SHORT}"
git push origin main
echo "✓ Pushed tag ${SHORT}"
env: