Skip to content

Commit

Permalink
fix: env
Browse files Browse the repository at this point in the history
  • Loading branch information
morgan-cromell committed Feb 14, 2025
1 parent 8fb2ce5 commit b732e9e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/actions/deploy/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,18 @@ runs:
if: inputs.env != ''
shell: bash
run: |
echo '${{ inputs.env }}' | while IFS='=' read -r key value; do
env_json="{"
while IFS='=' read -r key value; do
if [ ! -z "$key" ]; then
echo "ENV_VARS=\"${ENV_VARS:-}--set app.deployment.env.${key}=${value} \"" >> $GITHUB_ENV
# Add comma if not the first entry
if [ "$env_json" != "{" ]; then
env_json+=","
fi
env_json+="\"$key\":\"$value\""
fi
done
done <<< "${{ inputs.env }}"
env_json+="}"
echo "ENV_JSON=${env_json}" >> $GITHUB_ENV
- name: Deploy
uses: WyriHaximus/github-action-helm3@v3
Expand All @@ -71,6 +78,6 @@ runs:
--set app.deployment.port="${{ inputs.targetPort }}" \
--set app.deployment.memory.requests="${{ inputs.memoryRequests }}"\
--set app.deployment.memory.limit="${{ inputs.memoryLimit }}" \
${{ env.ENV_VARS }}
--set-json 'app.deployment.env=${{ env.ENV_JSON }}'
kubeconfig: '${{ inputs.kubeconfig }}'
overrule_existing_kubeconfig: "true"

0 comments on commit b732e9e

Please sign in to comment.