Skip to content
27 changes: 27 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Deploy to VM

on:
push:
branches:
- master

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.VM_KEY }}

- name: Deploy to VM
run: |
ssh [email protected] << 'EOF'
cd /home/Aarish/flask-hello-world
git pull origin master
sudo systemctl restart flaskapp
EOF
27 changes: 27 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Deploy to VM

on:
push:
branches:
- master

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.VM_KEY }}

- name: Deploy to VM
run: |
ssh StrictHostKeyChecking=no [email protected] << 'EOF'
cd /home/Aarish/flask-hello-world
git pull origin master
sudo systemctl restart flaskapp
EOF
4 changes: 3 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@

@app.route('/')
def hello_world():
return 'Hello, World!'
return 'Hello, World! This is Aarish Thanks '
if __name__ == "__main__":
app.run()