Files
kubernetes-dashboard-deploy…/.gitea/workflows/deploy.yml
T
feedc0de c60b230b9e
Validate and deploy Kubernetes Dashboard / validate (push) Successful in 18s
Validate and deploy Kubernetes Dashboard / deploy (push) Successful in 40s
Strip sha256 hash
2026-10-14 20:19:33 +02:00

75 lines
3.1 KiB
YAML

name: Validate and deploy Kubernetes Dashboard
on:
push:
pull_request:
env:
DASHBOARD_CHART_VERSION: 7.14.0
HELM_VERSION: v4.2.2
KUBECTL_VERSION: v1.36.3
KUBERNETES_API: https://host.containers.internal:6443
KUBERNETES_TLS_SERVER_NAME: 192.168.0.2
NAMESPACE: kubernetes-dashboard
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pinned Helm
run: |
curl -fsSL -o "${RUNNER_TEMP}/helm.tgz" "https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz"
tar -xzf "${RUNNER_TEMP}/helm.tgz" -C "${RUNNER_TEMP}" --strip-components=1 linux-amd64/helm
echo "${RUNNER_TEMP}" >> "${GITHUB_PATH}"
- run: bash test.sh
deploy:
if: gitea.ref == 'refs/heads/main'
needs: validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pinned tools
run: |
curl -fsSL -o "${RUNNER_TEMP}/helm.tgz" "https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz"
tar -xzf "${RUNNER_TEMP}/helm.tgz" -C "${RUNNER_TEMP}" --strip-components=1 linux-amd64/helm
curl -fsSL -o "${RUNNER_TEMP}/kubectl" "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl"
chmod 0700 "${RUNNER_TEMP}/helm" "${RUNNER_TEMP}/kubectl"
echo "${RUNNER_TEMP}" >> "${GITHUB_PATH}"
- name: Configure Kubernetes access
env:
KUBE_CONFIG_BASE64: ${{ secrets.KUBE_CONFIG_BASE64 }}
run: |
test -n "${KUBE_CONFIG_BASE64}"
printf '%s' "${KUBE_CONFIG_BASE64}" | base64 --decode > "${RUNNER_TEMP}/kubeconfig"
chmod 0600 "${RUNNER_TEMP}/kubeconfig"
export KUBECONFIG="${RUNNER_TEMP}/kubeconfig"
kubectl config set-cluster cluster --server="${KUBERNETES_API}" --tls-server-name="${KUBERNETES_TLS_SERVER_NAME}"
- name: Apply public desired state and verify
run: |
export KUBECONFIG="${RUNNER_TEMP}/kubeconfig"
./render.sh "${RUNNER_TEMP}/dashboard.yaml"
kubectl apply --server-side --force-conflicts --dry-run=server --validate=false \
--filename "${RUNNER_TEMP}/dashboard.yaml" \
--filename auth-proxy.yaml \
--filename kubernetes-dashboard-ingressroute.yaml
kubectl apply --server-side --force-conflicts --validate=false \
--filename "${RUNNER_TEMP}/dashboard.yaml" \
--filename auth-proxy.yaml \
--filename kubernetes-dashboard-ingressroute.yaml
bash ./wait-for-deployments.sh \
kubernetes-dashboard-api \
kubernetes-dashboard-auth \
kubernetes-dashboard-web \
kubernetes-dashboard-metrics-scraper \
kubernetes-dashboard-kong \
kubernetes-dashboard-auth-proxy
status=$(curl --silent --show-error --output /dev/null --write-out '%{http_code}' --max-time 15 https://kubernetes.brunner.ninja/)
case "${status}" in
302|303|307) ;;
*) echo "Expected Authentik redirect, received HTTP ${status}" >&2; exit 1 ;;
esac