Deploy to Kubernetes as part of pipeline #26
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Helm Chart CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Start minikube | |
uses: medyagh/[email protected] | |
with: | |
driver: docker | |
container-runtime: containerd | |
minikube-version: latest | |
kubernetes-version: stable | |
timeout-minutes: 2 | |
- name: Build and run chart | |
run: | | |
eval $(minikube -p minikube docker-env) | |
kubectl apply -f helm/deploy-ci.yaml | |
helm dependency build helm | |
helm upgrade --install --render-subchart-notes quality-time helm | |
kubectl wait --all pods --timeout=2m --for=condition=Ready | |
kubectl wait --all deployments --timeout=30s --for=condition=Available | |
timeout-minutes: 3 | |
- name: Check api health endpoint | |
run: | | |
eval $(minikube -p minikube docker-env) | |
kubectl port-forward "$(kubectl get pods -l app.kubernetes.io/component=api -o name)" 5001 & | |
sudo kubectl expose --type=NodePort deployment quality-time-api --port 5001 --name patch --overrides '{"apiVersion":"v1","spec":{"ports":[{"protocol":"TCP","port":5001,"nodePort":30001}]}}' | |
sleep 5 | |
curl -v localhost:5001/api/health | |
curl -v localhost:30001/api/health | |
[[ "$(curl -s localhost:30001/api/health)" == "{}" ]] | |
timeout-minutes: 1 |