Install kubectl and helm at job start
CI/CD (dev on branch, prod on tag) / setup (push) Successful in 11s
CI/CD (dev on branch, prod on tag) / build-and-deploy (push) Failing after 1m10s

The runner's job image only ships docker; download static binaries so
the diagnostics and deploy steps work.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Tom Chien (IQ-AS)
2026-11-17 14:59:42 +08:00
co-authored by Claude Opus 4.6
parent fb8b3fdcfb
commit 3e5eee0c68
+16
View File
@@ -65,6 +65,22 @@ jobs:
exit 1
fi
# The runner's job image ships docker but not kubectl/helm, so install
# them at job start (static binaries, linux/amd64).
- name: Install kubectl & helm
run: |
if ! command -v kubectl >/dev/null 2>&1; then
KVER=$(curl -sfL https://dl.k8s.io/release/stable.txt)
curl -sfL -o /usr/local/bin/kubectl "https://dl.k8s.io/release/${KVER}/bin/linux/amd64/kubectl"
chmod +x /usr/local/bin/kubectl
fi
if ! command -v helm >/dev/null 2>&1; then
curl -sfL https://get.helm.sh/helm-v3.16.4-linux-amd64.tar.gz | tar xz -C /tmp
mv /tmp/linux-amd64/helm /usr/local/bin/helm
fi
kubectl version --client
helm version
- name: Set up kubeconfig
run: |
echo "KUBECONFIG=${RUNNER_TEMP}/kubeconfig" >> "$GITHUB_ENV"