Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,30 @@ jobs:
docker tag "$IMAGE_NAME:latest" "$REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
docker push "$REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"

- name: Update Helm chart appVersion
- name: Update Helm chart metadata
run: |
set -euo pipefail
sed -i -E "s|^appVersion: .*|appVersion: \"${GITHUB_RUN_NUMBER}\"|" chart/Chart.yaml
sed -i -E "s|^ tag: .*| tag: \"${GITHUB_RUN_NUMBER}\"|" chart/values.yaml
current_version="$(awk '/^version:/ {gsub(/\"/, "", $2); print $2; exit}' chart/Chart.yaml)"
IFS='.' read -r major minor patch <<< "$current_version"
new_version="${major}.${minor}.$((patch + 1))"
sed -i -E "s|^version: .*|version: ${new_version}|" chart/Chart.yaml
echo "Updated appVersion and image tag to ${GITHUB_RUN_NUMBER}, and bumped chart version: ${current_version} -> ${new_version}"

- name: Commit chart appVersion update to master
- name: Commit chart metadata update to master
run: |
set -euo pipefail
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add chart/Chart.yaml
git add chart/Chart.yaml chart/values.yaml

if git diff --cached --quiet; then
echo "No changes to commit"
exit 0
fi

git commit -m "chore(ci): update chart appVersion to ${GITHUB_RUN_NUMBER} [skip ci]"
git commit -m "chore(ci): update chart metadata [skip ci]"
git push origin HEAD:master

# - name: Upload manifests artifact
Expand Down
Loading