File tree 1 file changed +11
-5
lines changed
1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 25
25
version=$(yq e '.version' "$path/Chart.yaml")
26
26
echo "{\"path\": \"$path\", \"name\": \"$name\", \"version\": \"$version\"}"
27
27
done | jq -s -c)
28
- echo "charts=${CHARTS_JSON}" | tee -a "$GITHUB_OUTPUT"
28
+ echo "charts=${CHARTS_JSON}" >> "$GITHUB_OUTPUT"
29
29
30
30
push-chart :
31
31
needs : [plan]
@@ -48,11 +48,17 @@ jobs:
48
48
- name : Helm login
49
49
run : echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u ${{ github.repository_owner }} --password-stdin
50
50
51
- - name : Package Helm Chart
51
+ - name : Check if Helm Chart Exists
52
+ id : check-existence
52
53
run : |
53
- helm package ${{ matrix.charts.path }} --destination packaged
54
+ if helm pull oci://ghcr.io/appthrust/charts/${{ matrix.charts.name }} --version ${{ matrix.charts.version }}; then
55
+ echo "chart_exists=true" >> $GITHUB_ENV
56
+ else
57
+ echo "chart_exists=false" >> $GITHUB_ENV
58
+ fi
54
59
55
60
- name : Push Helm Chart to GHCR
61
+ if : env.chart_exists == 'false'
56
62
run : |
57
- CHART_FILE=packaged/${{ matrix.charts.name }}- ${{ matrix.charts.version }}.tgz
58
- helm push $CHART_FILE oci://ghcr.io/appthrust/charts
63
+ helm package ${{ matrix.charts.path }} --destination packaged
64
+ helm push packaged/${{ matrix.charts.name }}-${{ matrix.charts.version }}.tgz oci://ghcr.io/appthrust/charts
You can’t perform that action at this time.
0 commit comments