Skip to content

Deploy WA JS

Deploy WA JS #15

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Node.js CD
on:
push:
branches: [ "main" ]
paths:
- 'whatsapp-js/**'
workflow_dispatch:
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Deploy using ssh
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.WA_SERVER }}
username: ${{ secrets.WA_SERVER_USERNAME }}
key: ${{ secrets.WA_SERVER_PRIVATE_KEY }}
port: 22
script: |
cd ~/flickmatch/home/whatsapp-js
git pull origin main
git status
~/.nvm/versions/node/v18.15.0/bin/pm2 restart main