Merge branch 'main' of https://github.com/raga70/OpenVidStreamer #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Via SSH To K8S | |
on: | |
push: | |
branches: | |
- main # Trigger on push to main branch, adjust as necessary | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install sshpass | |
run: sudo apt-get install -y sshpass | |
- name: Delay for other workflows to complete and push their images to docker hub | |
run: sleep 240 # Sleep for 240 seconds or 4 minutes | |
- name: Execute commands over SSH | |
env: | |
SSH_PASSWORD: ${{ secrets.DEPLSSH_PASSWORD }} | |
run: | | |
sshpass -p $SSH_PASSWORD ssh -o StrictHostKeyChecking=no [email protected] << EOF | |
microk8s kubectl delete deployment --all | |
microk8s kubectl delete svc --all | |
sleep 5 | |
microk8s ctr images remove docker.io/openvidstreamer/apigateway:latest | |
microk8s ctr images remove docker.io/openvidstreamer/render:latest | |
microk8s ctr images remove docker.io/openvidstreamer/recommendationalgo:latest | |
microk8s ctr images remove docker.io/openvidstreamer/account:latest | |
microk8s ctr images remove docker.io/openvidstreamer/videostreamer:latest | |
microk8s ctr images remove docker.io/openvidstreamer/videolibrary:latest | |
microk8s ctr images remove docker.io/openvidstreamer/upload:latest | |
cd ~/OpenVidStreamerKubernetesFiles | |
microk8s kubectl apply -f . | |
EOF |