@@ -59,10 +59,11 @@ jobs:
5959 tags : |
6060 ${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:${{ needs.versioning.outputs.MajorMinorPatch }}
6161 ${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:latest
62- build-helm :
62+
63+ build-helm-oci :
6364 name : Helm Building
6465 runs-on : ubuntu-latest
65- needs : [versioning, test ]
66+ needs : [build-docker ]
6667 if : github.ref_name == 'main' || github.event_name == 'release'
6768 steps :
6869 - uses : actions/checkout@v4
7374 helm registry login ${{ secrets.DOCKER_REGISTRY }} --username ${{ secrets.DOCKER_USERNAME }} --password ${{ secrets.DOCKER_PASSWORD }}
7475 helm push swagger-operator-${{ needs.versioning.outputs.MajorMinorPatch }}-chart.tgz oci://${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_USERNAME }}
7576
77+ build-helm :
78+ name : Helm Build & Publish to GitHub Pages
79+ runs-on : ubuntu-latest
80+ needs : [versioning, test]
81+ if : github.ref_name == 'main' || github.event_name == 'release'
82+ steps :
83+ - uses : actions/checkout@v4
84+
85+ - name : Set up Helm
86+ uses : azure/setup-helm@v4
87+
88+ - name : Package Helm chart
89+ run : |
90+ helm package ./charts/swagger-operator \
91+ --app-version ${{ needs.versioning.outputs.MajorMinorPatch }} \
92+ --version ${{ needs.versioning.outputs.MajorMinorPatch }}-chart
93+ mkdir -p helm-charts
94+ mv swagger-operator-*.tgz helm-charts/
95+
96+ - name : Checkout gh-pages branch
97+ uses : actions/checkout@v4
98+ with :
99+ ref : gh-pages
100+ path : gh-pages
101+
102+ - name : Copy new chart to gh-pages
103+ run : |
104+ cp helm-charts/*.tgz gh-pages/
105+ cd gh-pages
106+ helm repo index . --url https://ziul.github.io/swagger-operator/
107+
108+ - name : Commit and push changes
109+ run : |
110+ cd gh-pages
111+ git config user.name "github-actions[bot]"
112+ git config user.email "github-actions[bot]@users.noreply.github.com"
113+ git add .
114+ git commit -m "Update Helm chart [skip ci]" || echo "No changes to commit"
115+ git push origin gh-pages
116+
0 commit comments