diff --git a/.github/workflows/helm-local.yml b/.github/workflows/helm-local.yml new file mode 100644 index 00000000..70d75097 --- /dev/null +++ b/.github/workflows/helm-local.yml @@ -0,0 +1,59 @@ +# This is a basic workflow to help you get started with Actions + +name: Helm local chart + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the main branch + push: + branches: [ main ] + pull_request: + branches: [ main ] + + workflow_call: + inputs: + APP_NAME: + required: true + type: string + CHART_PATH: + required: true + type: string + NAMESPACE: + required: true + type: string + CLOUD_PROVIDER: + required: true + type: string + REGION: + required: true + type: string + CLUSTER_NAME: + required: true + type: string + secrets: + KUBECONFIG: + required: true +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "deploy" + deploy: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + - name: Install Helm + uses: azure/setup-helm@v1 + with: + version: v3.8.1 + - name: Dependency update + uses: WyriHaximus/github-action-helm3@v2 + with: + exec: cd ${{ inputs.CHART_PATH }} ; helm dependency update + - name: Deploy + uses: WyriHaximus/github-action-helm3@v2 + with: + exec: helm upgrade '${{ inputs.APP_NAME }}' ${{ inputs.CHART_PATH }} --install --create-namespace --namespace=${{ inputs.NAMESPACE }} -f=${{ inputs.APP_NAME }}/values/${{ inputs.CLOUD_PROVIDER }}/values_${{ inputs.REGION }}_${{ inputs.CLUSTER_NAME }}.yaml + kubeconfig: '${{ secrets.KUBECONFIG }}'