From c9f240c0c4feb4f5a9a6c4a70691105c9b75c99e Mon Sep 17 00:00:00 2001 From: Francesco Camuffo Date: Fri, 11 Oct 2024 14:46:13 +0200 Subject: [PATCH] Add K8s deploy workflow --- .github/workflows/k8s-deploy.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/k8s-deploy.yml diff --git a/.github/workflows/k8s-deploy.yml b/.github/workflows/k8s-deploy.yml new file mode 100644 index 0000000..5b79288 --- /dev/null +++ b/.github/workflows/k8s-deploy.yml @@ -0,0 +1,29 @@ +name: Deploy to Kubernetes + +on: + push: + branches: ["development", "k8s-deploy"] + pull_request: + branches: ["development"] + +jobs: + deploy: + env: + NAMESPACE: "gn-demo-dev" + KUBECONFIG: "${{ github.workspace }}/.kube/config" + + runs-on: ubuntu-24.04 + + steps: + - uses: actions/checkout@v4 + + - name: "Write to $KUBECONFIG" + run: | + mkdir -p '${{ github.workspace }}/.kube' \ + && echo '${{ secrets.K8S_CONFIG }}' | base64 -d > "$KUBECONFIG" + + - run: "kubectl version" + + - name: Deploy to Kubernetes + run: | + helm -n "$NAMESPACE" list