Skip to content

Commit fe8a181

Browse files
authored
Merge pull request #1 from Aarishmd/workflow
Create deploy.yaml
2 parents 6b251b2 + 7a8f623 commit fe8a181

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

deploy.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Deploy to VM
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Set up SSH
17+
uses: webfactory/[email protected]
18+
with:
19+
ssh-private-key: ${{ secrets.VM_KEY }}
20+
21+
- name: Deploy to VM
22+
run: |
23+
ssh -o StrictHostKeyChecking=no ${{ secrets.VM_USER }}@${{ secrets.VM_HOST }} << 'EOF'
24+
cd /home/Aarish/flask-hello-world
25+
git pull origin master
26+
sudo systemctl restart flaskapp
27+
EOF

0 commit comments

Comments
 (0)