From 88cea8fe59b4a4f3b3257c52ea3724baac07d457 Mon Sep 17 00:00:00 2001 From: Dinush Chathurya Date: Wed, 7 Jun 2023 15:19:05 +0530 Subject: [PATCH] feat: Initialize the project --- .../deploy-to-minikube-github-actions.yaml | 38 +++++++++++-------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/.github/workflows/deploy-to-minikube-github-actions.yaml b/.github/workflows/deploy-to-minikube-github-actions.yaml index 9bd7fea..57020eb 100644 --- a/.github/workflows/deploy-to-minikube-github-actions.yaml +++ b/.github/workflows/deploy-to-minikube-github-actions.yaml @@ -1,28 +1,36 @@ name: Deploy to Minikube using GitHub Actions -on: [push] +on: + push: jobs: job1: runs-on: ubuntu-latest - name: build Node.js Docker Image and deploy to minikube + name: Build Node.js Docker Image and deploy to Minikube steps: - - uses: actions/checkout@v2 - - name: Start minikube - uses: medyagh/setup-minikube@master - - name: Try the cluster ! - run: kubectl get pods -A - - name: Build image - run: | + - uses: actions/checkout@v2 + - name: Start Minikube + uses: medyagh/setup-minikube@master + - name: Try the cluster! + run: kubectl get pods -A + - name: Build image + run: | export SHELL=/bin/bash eval $(minikube -p minikube docker-env) docker build -f ./Dockerfile -t devopshint/node-app:latest . - echo -n "verifying images:" + echo -n "Verifying images:" docker images - - name: Deploy to minikube - run: - kubectl apply -f k8s-node-app.yaml - - name: Test service URLs - run: | + - name: Deploy to Minikube + run: + kubectl apply -f k8s-node-app.yaml + - name: Test service URLs + run: | minikube service list minikube service nodejs-app --url + + keep-alive: + runs-on: ubuntu-latest + needs: job1 + steps: + - name: Keep Alive + run: sleep infinity