Skip to content

Merge pull request #2 from NeonLightTFC/patch-1 #92

Merge pull request #2 from NeonLightTFC/patch-1

Merge pull request #2 from NeonLightTFC/patch-1 #92

Workflow file for this run

# The following script assumes the following:
#
# Depencencies installed on the destination machine: pm2
# * `~/inhouse-bot` is this cloned repo in the user's home directory
# * Environment variable DISCORD_TOKEN is set or set in a .env file locally in the repo location
# * discory.py and python-dotenv dependencies are installed (e.g., `pip3.8 install discord.py python-dotenv`)
# * `pm2 start inhouse-bot.py --interpreter=python3.8 --name inhouse-bot` was previously run
name: Deploy inhouse-bot
# Controls when the action will run.
on:
push:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
deploy:
# 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 script
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_NAME }}
username: ${{ secrets.DEPLOY_USER }}
password: ${{ secrets.DEPLOY_PASSWORD }}
script: |
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
cd ~/inhouse-bot
git reset --hard main
git pull origin main
pm2 restart inhouse-bot --update-env
pm2 restart inhouse-comms --update-env