Deploy Backend #9
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 Backend | |
on: | |
workflow_dispatch: | |
workflow_call: | |
secrets: | |
VM_HOST: | |
required: true | |
VM_USERNAME: | |
required: true | |
VM_PRIVATE_KEY: | |
required: true | |
VM_PORT: | |
required: true | |
jobs: | |
k8sDeploy: | |
name: k8sDeploy | |
runs-on: ubuntu-latest | |
environment: prod | |
steps: | |
- name: 'Deploy on k8s' | |
uses: appleboy/ssh-action@029f5b4aeeeb58fdfe1410a5d17f967dacf36262 #v1.0.3 | |
with: | |
host: ${{ secrets.VM_HOST }} | |
username: ${{ secrets.VM_USERNAME }} | |
key: ${{ secrets.VM_PRIVATE_KEY }} | |
port: ${{ secrets.VM_PORT }} | |
fingerprint: ${{ secrets.HOST_FINGERPRINT }} | |
script: | | |
mkdir -p expenses-monitor/backend && cd expenses-monitor/backend | |
wget -O manifest.yaml https://raw.githubusercontent.com/and-mora/expenses-monitor/master/backend_deploy/manifest.yaml | |
kubectl apply -f manifest.yaml | |
kubectl wait --for=condition=Ready pod -n expenses-monitor -l app=backend --timeout=300s |