This repository contains a Helm chart for deploying a simple NGINX-based web application (mywebapp) into a Kubernetes cluster using GitHub Actions for CI/CD and GitHub Pages to host the chart as a Helm repository.
mywebapp_helm/
├── charts/
│ ├── index.yaml # Helm chart index
│ ├── mywebapp/ # Helm chart directory
│ │ ├── Chart.yaml
│ │ ├── values.yaml
│ │ ├── app/index.html # Static web content
│ │ └── templates/ # Kubernetes manifest templates
│ │ ├── configmap.yaml
│ │ ├── deployment.yaml
│ │ ├── ingress.yaml
│ │ ├── service.yaml
│ │ └── _helpers.tpl
├── .github/workflows/
│ └── helm-release.yaml # GitHub Actions workflow
└── README.md
- Helm chart with NGINX serving custom HTML via ConfigMap
- Ingress support with configurable hostname and path
- GitHub Actions-based deployment to Kubernetes cluster
- Helm chart hosting using GitHub Pages
- A Kubernetes cluster (e.g., minikube, k3s, EKS, etc.)
kubectlandhelminstalled locally- NGINX Ingress Controller (if using ingress)
- GitHub Personal Access Token (PAT) with
repoand optionallyworkflowscope KUBECONFIGsecret in GitHub repository (for GitHub Actions)
cd charts/
helm package mywebapp
helm repo index . --url https://ibrahim88ku.github.io/mywebapp- Switch to
gh-pagesbranch:git checkout gh-pages
- Move Helm package and
index.yamlto the root:cp charts/index.yaml charts/mywebapp-<version>.tgz .
- Commit and push:
git add index.yaml mywebapp-<version>.tgz git commit -m "Release Helm chart version <version>" git push origin gh-pages
Ensure GitHub Pages is enabled in repository settings:
- Branch:
gh-pages - Folder:
/ (root) - Published URL: https://ibrahim88ku.github.io/mywebapp
The GitHub Actions workflow .github/workflows/helm-release.yaml:
- Triggers on
mainbranch push - Sets up Helm
- Applies deployment to your cluster using the KUBECONFIG secret
Add the repo:
helm repo add mywebapp https://ibrahim88ku.github.io/mywebapp
helm repo updateInstall the chart:
helm install mywebapp mywebapp/mywebapp --version 0.1.5 -n staging --create-namespaceOr upgrade an existing release:
helm upgrade mywebapp mywebapp/mywebapp --version 0.1.5 -n stagingExample in values.yaml:
ingress:
enabled: true
className: nginx
hosts:
- host: mywebapp.local
paths:
- path: /
pathType: PrefixIbrahim Khalil
GitHub: @ibrahim88ku
This project is licensed under the MIT License.