Skip to content

Commit

Permalink
fix cd
Browse files Browse the repository at this point in the history
  • Loading branch information
tungleanh0902 committed Feb 19, 2024
1 parent f4ad7d0 commit 0aae29c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ on:
# Push to long living branches or PRs
push:
branches:
- master
- main
- staging

jobs:
deploy:
Expand All @@ -25,5 +24,5 @@ jobs:
key: ${{ secrets.PRIV_KEY }}
envs: CI, NODE_OPTIONS
script: |
cd ~/multisig.notional.ventures
cd ~/multisig-ui
bash deploy.sh
16 changes: 3 additions & 13 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down

0 comments on commit 0aae29c

Please sign in to comment.