Skip to content

Commit

Permalink
Merge pull request #30 from FlowFuse/fix-helm-empty-values
Browse files Browse the repository at this point in the history
FIX: helm deployment crashes when no inline values are passed to the workflow
  • Loading branch information
hardillb authored Dec 15, 2023
2 parents df4f90e + 2c77c66 commit 6f324a9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/deploy_helm_chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ on:
description: 'Comma separated list of value set for helms. Example: "key1=value1,key2=value2"'
type: string
required: false
default: null
chart_namespace:
description: 'Kubernetes namespace where chart will be deployed'
type: string
Expand Down Expand Up @@ -71,7 +72,6 @@ on:
description: 'Comma separated list of value set for helms which should not be exposed in runner logs. Example: "key1=value1,key2=value2"'
required: false


jobs:
deploy:
runs-on: ubuntu-latest
Expand All @@ -91,6 +91,15 @@ jobs:
role-session-name: GithubActionsRoleSession
role-duration-seconds: 900

- name: Set chart values
run: |
if [ "${{ secrets.chart_secret_values }}" == "" ]
then
echo "VALUES=${{ inputs.chart_values }}" >> $GITHUB_ENV
else
echo "VALUES=${{ format('{0},{1}', secrets.chart_secret_values, inputs.chart_values) }}" >> $GITHUB_ENV
fi
- name: Deploy Helm
uses: bitovi/[email protected]
with:
Expand All @@ -100,7 +109,7 @@ jobs:
chart-repository: ${{ inputs.chart_repository }}
chart-path: ${{ inputs.chart_path }}
config-files: ${{ inputs.chart_values_file }}
values: ${{ format('{0},{1}', secrets.chart_secret_values, inputs.chart_values) }}
values: ${{ env.VALUES }}
namespace: ${{ inputs.chart_namespace }}
name: ${{ inputs.chart_name }}
version: ${{ inputs.chart_version }}
Expand Down

0 comments on commit 6f324a9

Please sign in to comment.