@@ -760,67 +760,18 @@ jobs:
760
760
761
761
publish-helm :
762
762
name : Package and Publish Helm Chart
763
- runs-on : ubuntu-22.04
764
763
needs : [checks, helm-tests]
765
764
if : ${{ github.event_name == 'push' && ! startsWith(github.ref, 'refs/heads/release-') }}
766
765
permissions :
767
766
contents : write # for pushing to Helm Charts repository
768
767
packages : write # for helm to push to GHCR
769
- steps :
770
- - name : Checkout Repository
771
- uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
772
- with :
773
- path : kic
774
-
775
- - name : Login to GitHub Container Registry
776
- uses : docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
777
- with :
778
- registry : ghcr.io
779
- username : ${{ github.repository_owner }}
780
- password : ${{ secrets.GITHUB_TOKEN }}
781
-
782
- - name : DockerHub Login
783
- uses : docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
784
- with :
785
- username : ${{ secrets.DOCKER_USERNAME }}
786
- password : ${{ secrets.DOCKER_PASSWORD }}
787
-
788
- - name : Package
789
- id : package
790
- run : |
791
- helm_versions=""
792
- if [ ${{ github.ref_type }} != "tag" ]; then
793
- helm_versions="--app-version edge --version 0.0.0-edge"
794
- else
795
- helm_versions="--app-version ${{ needs.checks.outputs.ic_version }} --version ${{ needs.checks.outputs.chart_version }}"
796
- fi
797
- output=$(helm package ${helm_versions} kic/charts/nginx-ingress)
798
- echo "path=$(basename -- $(echo $output | cut -d: -f2))" >> $GITHUB_OUTPUT
799
-
800
- - name : Push to OCI registries
801
- run : |
802
- helm push ${{ steps.package.outputs.path }} oci://ghcr.io/nginxinc/charts
803
- helm push ${{ steps.package.outputs.path }} oci://registry-1.docker.io/nginxcharts
804
-
805
- - name : Checkout Repository
806
- uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
807
- with :
808
- repository : nginxinc/helm-charts
809
- fetch-depth : 1
810
- token : ${{ secrets.NGINX_PAT }}
811
- path : helm-charts
812
- if : github.ref_type == 'tag'
813
-
814
- - name : Push Helm Chart to Helm Charts Repository
815
- run : |
816
- mv ${{ steps.package.outputs.path }} ${{ github.workspace }}/helm-charts/stable/
817
- cd ${{ github.workspace }}/helm-charts
818
- helm repo index stable --url https://helm.nginx.com/stable
819
- git add -A
820
- git -c user.name='NGINX Kubernetes Team' -c user.email='kubernetes@nginx.com' \
821
- commit -m "NGINX Ingress Controller - Release ${{ needs.checks.outputs.chart_version }}"
822
- git push -u origin master
823
- if : github.ref_type == 'tag'
768
+ uses : ./.github/workflows/publish-helm.yml
769
+ with :
770
+ branch : ${{ github.ref_name }}
771
+ ic_version : ${{ github.ref_type == 'tag' && needs.checks.outputs.ic_version || '0.0.0-edge' }}
772
+ chart_version : ${{ github.ref_type == 'tag' && needs.checks.outputs.chart_version || 'edge' }}
773
+ nginx_helm_repo : ${{ github.ref_type == 'tag' }}
774
+ secrets : inherit
824
775
825
776
operator :
826
777
name : Trigger PR for Operator
0 commit comments