mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-15 12:25:50 +00:00
updated to cicd
This commit is contained in:
parent
ba578d9d3b
commit
16c13fa7c2
1 changed files with 19 additions and 1 deletions
20
.github/workflows/build.yml
vendored
20
.github/workflows/build.yml
vendored
|
@ -7,7 +7,7 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: self-hosted
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
@ -36,3 +36,21 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
docker push ybandala/petclinic:${{ github.sha }}
|
docker push ybandala/petclinic:${{ github.sha }}
|
||||||
docker push ybandala/petclinic:latest
|
docker push ybandala/petclinic:latest
|
||||||
|
|
||||||
|
- name: Install kubectl
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y kubectl
|
||||||
|
|
||||||
|
- name: Set Minikube context
|
||||||
|
run: kubectl config use-context minikube
|
||||||
|
|
||||||
|
- name: Deploy to Minikube
|
||||||
|
run: |
|
||||||
|
sed -i 's|image: .*|image: your-dockerhub-username/petclinic:'${{ github.sha }}'|' k8s/base/deployment.yaml
|
||||||
|
|
||||||
|
# Apply the Kubernetes manifests
|
||||||
|
kubectl apply -f k8s/base/
|
||||||
|
|
||||||
|
# Wait for deployment to complete
|
||||||
|
kubectl rollout status deployment/petclinic -n petclinic-dev --timeout=180s
|
||||||
|
|
Loading…
Reference in a new issue