Skip to content

Deploy to prod on push #83

Deploy to prod on push

Deploy to prod on push #83

Workflow file for this run

name: Deploy to prod on push
on:
workflow_run:
workflows: ['Lint']
types:
- completed
push:
paths:
- src/**
- .github/workflows/lint.yml
- .github/workflows/prod.yml
branches: [prod]
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Pull and install
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST_PROD }}
username: ${{ secrets.SSH_USERNAME_PROD }}
port: ${{ secrets.SSH_PORT_PROD }}
password: ${{ secrets.SSH_PASSWORD_PROD }}
script: |
source ~/.bashrc
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
cd crm-bot && git fetch --all && git reset --hard origin/prod && yarn install && pm2 delete crm-bot && yarn pm2