diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..3adb38f --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,26 @@ +name: Deploy to VM + +on: + push: + branches: [main] + pull_request: + branches: [main] + +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/Video/tmp + + - name: Execute remote command + run: ssh ${{ secrets.USER_AND_IP }} sudo /var/www/deploy-node.sh video.henryhiles.com Video 3001