From fed1400811a2b913e6fe59e90602c75a6b5a3978 Mon Sep 17 00:00:00 2001 From: Chase Moskal Date: Sat, 14 Sep 2024 17:13:58 -0700 Subject: [PATCH] wip: pm2 deployment --- .github/workflows/release.yaml | 3 ++- bin/serverside/redeploy | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 bin/serverside/redeploy diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5b9a430..4f0a2d0 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -30,7 +30,7 @@ jobs: with: version: v2.2.2 - - run: npm ci + - run: npm ci --production - run: npm run build - run: npm test @@ -45,6 +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 app && bin/serverside/redeploy" - name: 🌎 download assets env: diff --git a/bin/serverside/redeploy b/bin/serverside/redeploy new file mode 100755 index 0000000..3920094 --- /dev/null +++ b/bin/serverside/redeploy @@ -0,0 +1,11 @@ +#!/bin/bash + +# +# this script is meant to be run on the director's production server. +# do not run this locally in your dev environment.. +# + +npm ci --production + +pm2 restart director || pm2 start "npm run director --silent" --name director +