Add text2image microservice support #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (C) 2025 Intel Corporation | |
# SPDX-License-Identifier: Apache-2.0 | |
name: Update the helm charts 0-latest | |
on: | |
pull_request: | |
branches: | |
- main | |
types: [closed] | |
paths: | |
- helm-charts/** | |
env: | |
CHARTS_DIR: "helm-charts" | |
jobs: | |
run-on-merge: | |
if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.ref }} | |
- name: Get the modified charts list | |
run: | | |
echo "This job runs after a PR is merged!" | |
if grep -r '^version: ' `find helm-charts/ -name "Chart.yaml"` | grep -v "0-latest"; then | |
echo "Version check failed, only update 0-latest" | |
exit 1 | |
fi | |
base_commit=${{ github.event.pull_request.base.sha }} | |
merged_commit=$(git log -1 --format='%H') | |
# Update components | |
common_charts=$(git diff --name-only ${base_commit} ${merged_commit} | \ | |
grep "^$CHARTS_DIR/common" | \ | |
grep -vE 'README.md|*.sh' | \ | |
cut -d'/' -f3 | sort -u ) | |
echo "Charts to be updated: $common_charts" | |
echo "${{ secrets.ACTION_TOKEN }}" | helm registry login ghcr.io -u opea --password-stdin | |
pushd $CHARTS_DIR/common | |
for chart in ${common_charts}; do | |
echo "Updating $chart" | |
helm dependency update ${chart} | |
helm package $chart | |
helm push ${chart}-0-latest.tgz oci://ghcr.io/opea-project/charts | |
done | |
popd | |
# Update Examples | |
e2e_charts=$(git diff --name-only ${base_commit} ${merged_commit} | \ | |
grep -v "common" | \ | |
grep -vE 'README.md|*.sh' | \ | |
cut -d'/' -f2 | sort -u ) | |
echo "Charts to be updated: $e2e_charts" | |
echo "${{ secrets.ACTION_TOKEN }}" | helm registry login ghcr.io -u opea --password-stdin | |
pushd $CHARTS_DIR | |
for chart in ${e2e_charts}; do | |
echo "Updating $chart" | |
helm dependency update ${chart} | |
helm package $chart | |
helm push ${chart}-0-latest.tgz oci://ghcr.io/opea-project/charts | |
done | |
popd |