diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9fe85b0..1f50eb7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -45,7 +45,7 @@ jobs: - name: deploy the director run: | rsync -vhamz --delete --exclude ".git" --exclude "node_modules" -e "ssh -o StrictHostKeyChecking=no" ./ deployer@director.regis.gg:/home/deployer/app/ - ssh -o StrictHostKeyChecking=no deployer@director.regis.gg "cd /home/deployer && source .bashrc && cd app && bin/serverside/redeploy" + ssh -o StrictHostKeyChecking=no deployer@director.regis.gg "cd /home/deployer/app && bin/serverside/redeploy" - name: 🌎 download assets env: diff --git a/bin/serverside/redeploy b/bin/serverside/redeploy index 3920094..5bd3be0 100755 --- a/bin/serverside/redeploy +++ b/bin/serverside/redeploy @@ -5,6 +5,11 @@ # do not run this locally in your dev environment.. # +# prepare the environment +source "$HOME/.profile" +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + npm ci --production pm2 restart director || pm2 start "npm run director --silent" --name director