diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 490d7cd9..bb81a0a7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,8 +3,7 @@ on: # Push to long living branches or PRs push: branches: - - master - - main + - staging jobs: deploy: @@ -25,5 +24,5 @@ jobs: key: ${{ secrets.PRIV_KEY }} envs: CI, NODE_OPTIONS script: | - cd ~/multisig.notional.ventures + cd ~/multisig-ui bash deploy.sh diff --git a/deploy.sh b/deploy.sh index a6c64bcc..371ba87d 100644 --- a/deploy.sh +++ b/deploy.sh @@ -1,5 +1,5 @@ #!/bin/bash -git stash save --keep-index --include-untracked +# git stash save --keep-index --include-untracked git pull export PATH=/root/.nvm/versions/node/v18.9.0/bin:$PATH @@ -8,22 +8,12 @@ if ! [ $? -eq 0 ]; then exit 1 fi -if [ -f "../env-multisig" ]; then - echo "Multisig env file exists." - cp ../env-multisig .env -fi - -cp multisig.notional.ventures.service /etc/systemd/system/multisig.notional.ventures.service -systemctl stop multisig.notional.ventures.service -systemctl daemon-reload -echo "Service file copied!" - npm install npm run build if [ $? -eq 0 ]; then - systemctl restart multisig.notional.ventures.service - systemctl is-active --quiet multisig.notional.ventures.service && echo "Multisig web server restarted successfully." || (echo "Multisig web server failed to restart." && exit 1) + echo "Multisig web deploying" + pm2 restart ecosystem.config.js --env prod else echo "npm run build failed with error. Stopped restarting the web server." exit 1