From 8763dcc99c6815b8702156438af8e40075568909 Mon Sep 17 00:00:00 2001 From: Andrey Litvitski Date: Mon, 11 Nov 2024 23:30:06 +0300 Subject: [PATCH] Implement K8S deployment testing using Kind in GitHub Actions --- .github/workflows/deploy-and-test-cluster.yml | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/deploy-and-test-cluster.yml diff --git a/.github/workflows/deploy-and-test-cluster.yml b/.github/workflows/deploy-and-test-cluster.yml new file mode 100644 index 00000000000..7353a604bba --- /dev/null +++ b/.github/workflows/deploy-and-test-cluster.yml @@ -0,0 +1,31 @@ +name: Deploy and Test Cluster + +on: + push: + branches: [main] + paths: + - 'k8s/**' + pull_request: + branches: [main] + paths: + - 'k8s/**' + +jobs: + deploy-and-test-cluster: + runs-on: ubuntu-latest + steps: + - name: Check out the repository + uses: actions/checkout@v2 + + - name: Create k8s Kind Cluster + uses: helm/kind-action@v1 + + - name: Deploy application + run: | + kubectl apply -f k8s/ + + - name: Wait for Pods to be ready + run: | + kubectl wait --for=condition=ready pod -l app=demo-db --timeout=180s + kubectl wait --for=condition=ready pod -l app=petclinic --timeout=180s +