diff --git a/action.yaml b/action.yaml index 9651195..cc3165d 100644 --- a/action.yaml +++ b/action.yaml @@ -36,6 +36,10 @@ inputs: description: "Kubernetes namespace to deploy helm charts on (default: ci-{github.repository}-{github.workflow}-{github.ref} )" required: false default: "" + timeout: + description: "Timeout for helm install (default: 10m)" + required: false + default: "10m" outputs: namespace: @@ -114,14 +118,13 @@ runs: helm search repo starship/devnet shell: bash - - name: Helm delete before install - run: | - helm delete ${{ inputs.name }} --debug --namespace ${{ steps.set-namespace.outputs.namespace }} --wait || true - shell: bash - - name: Helm install + id: helm-install-1 + continue-on-error: true run: | - helm install -f ${{ inputs.name }}-values.yaml ${{ inputs.name }} ${{ inputs.chart }} --wait --debug --version ${{ inputs.version }} --timeout 30m0s --namespace ${{ steps.set-namespace.outputs.namespace }} --create-namespace + helm delete ${{ inputs.name }} --debug --namespace ${{ steps.set-namespace.outputs.namespace }} --wait || true + sleep 5 + helm install -f ${{ inputs.name }}-values.yaml ${{ inputs.name }} ${{ inputs.chart }} --wait --debug --version ${{ inputs.version }} --timeout ${{ inputs.timeout }} --namespace ${{ steps.set-namespace.outputs.namespace }} --create-namespace shell: bash - name: Logs @@ -140,6 +143,16 @@ runs: NAMESPACE: ${{ steps.set-namespace.outputs.namespace }} shell: bash + - name: Helm install again + id: helm-install-2 + if: steps.helm-install-1.outcome == 'failure' + run: | + helm delete ${{ inputs.name }} --debug --namespace ${{ steps.set-namespace.outputs.namespace }} --wait || true + sleep 5 + kubectl get pods --namespace ${{ steps.set-namespace.outputs.namespace }} + helm install -f ${{ inputs.name }}-values.yaml ${{ inputs.name }} ${{ inputs.chart }} --wait --debug --version ${{ inputs.version }} --timeout ${{ inputs.timeout }} --namespace ${{ steps.set-namespace.outputs.namespace }} --create-namespace + shell: bash + - name: Port forward if: ${{ inputs.port-forward == 'true' }} run: ${{ github.action_path }}/port_forward.sh --config=$VALUES_FILE