ci: add set -e and debug logging
Some checks failed
Build & Deploy Go API / build (push) Failing after 3s

This commit is contained in:
Joe
2026-07-19 20:28:34 +08:00
parent b85d618f91
commit 23be40cbd5

View File

@@ -44,19 +44,24 @@ jobs:
- name: Update image tag in values.yaml (commit-back GitOps) - name: Update image tag in values.yaml (commit-back GitOps)
run: | run: |
set -e
WORK=/root/.cache/demo-go-api WORK=/root/.cache/demo-go-api
cd $WORK cd $WORK
SHORT=${GITHUB_SHA::8} SHORT=${GITHUB_SHA::8}
# Use sed to update image.tag in helm values.yaml echo "Updating tag to ${SHORT}"
sed -i "s/^ tag:.*/ tag: \"${SHORT}\"/" deploy/helm/values.yaml sed -i "s/^ tag:.*/ tag: \"${SHORT}\"/" deploy/helm/values.yaml
# Show the diff echo "--- diff ---"
git diff deploy/helm/values.yaml git diff deploy/helm/values.yaml || true
# Commit and push
git config user.email "ci@local" git config user.email "ci@local"
git config user.name "gitea-ci" git config user.name "gitea-ci"
if git diff --quiet deploy/helm/values.yaml; then
echo "No changes to commit"
exit 0
fi
git add deploy/helm/values.yaml git add deploy/helm/values.yaml
git commit -m "ci: update image tag to ${SHORT}" git commit -m "ci: update image tag to ${SHORT}"
git push origin main git push origin main
echo "✓ Pushed tag ${SHORT}"
env: env:
GITHUB_SHA: ${{ github.sha }} GITHUB_SHA: ${{ github.sha }}
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}