Added deploy.yml

This commit is contained in:
Henry Hiles 2022-02-10 10:23:19 -05:00
parent 9a221a1427
commit 44d42f88f7

26
.github/workflows/deploy.yml vendored Normal file
View file

@ -0,0 +1,26 @@
name: Deploy to VM
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install SSH key
uses: shimataro/ssh-key-action@6f350ca8484d8d55c2e361e74d17e638dabe713a
with:
key: ${{ secrets.SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- name: Copy files to VM
run: rsync -chav --delete ./ ${{ secrets.USER_AND_IP }}:/var/www/Chat/tmp
- name: Execute remote command
run: ssh ${{ secrets.USER_AND_IP }} sudo /var/www/deploy-node.sh chat.henryhiles.com Chat 3000