From e0ba3a2f5377dc3daeed8a85bf1a18ddb2a0a4e9 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..527430b --- /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 }}' > "$KUBECONFIG" + + - run: "kubectl version" + + - name: Deploy to Kubernetes + run: | + helm -n "$NAMESPACE" list