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
kubectl and helm installed locallyrepo and optionally workflow scopeKUBECONFIG secret in GitHub repository (for GitHub Actions)cd charts/
helm package mywebapp
helm repo index . --url https://ibrahim88ku.github.io/mywebapp
gh-pages branch:
git checkout gh-pages
index.yaml to the root:
cp charts/index.yaml charts/mywebapp-<version>.tgz .
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:
gh-pages/ (root)The GitHub Actions workflow .github/workflows/helm-release.yaml:
main branch pushAdd the repo:
helm repo add mywebapp https://ibrahim88ku.github.io/mywebapp
helm repo update
Install the chart:
helm install mywebapp mywebapp/mywebapp --version 0.1.5 -n staging --create-namespace
Or upgrade an existing release:
helm upgrade mywebapp mywebapp/mywebapp --version 0.1.5 -n staging
Example in values.yaml:
ingress:
enabled: true
className: nginx
hosts:
- host: mywebapp.local
paths:
- path: /
pathType: Prefix
Ibrahim Khalil
GitHub: @ibrahim88ku
This project is licensed under the MIT License.