From 44d42f88f7c620640bb35a3ed9529022124fa27f Mon Sep 17 00:00:00 2001 From: Henry Hiles Date: Thu, 10 Feb 2022 10:23:19 -0500 Subject: [PATCH] Added deploy.yml --- .github/workflows/deploy.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..80b5e33 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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