Skip to content

Commit

Permalink
Merge pull request #218 from wri/chore/upgrade-deploy-script
Browse files Browse the repository at this point in the history
Chore/upgrade deploy script
  • Loading branch information
tsubik authored Sep 12, 2024
2 parents 1c48948 + df24c41 commit 3278fda
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ jobs:
run: yarn cypress run

- name: Uploading Test Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: failure()
with:
name: e2e-tests-artifacts
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.17.0
v20
13 changes: 8 additions & 5 deletions script/deploy
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ echo "set project directory"
cd "$(dirname "$(readlink -f "$0")")"
cd ".."

export PATH="$HOME/.local/bin:$PATH"
export NVM_DIR="$HOME/.nvm"
. $NVM_DIR/nvm.sh

Expand All @@ -22,10 +23,12 @@ yarn transifex:pull
echo "--> Building assets"
yarn build

echo "--> Restarting server"

if [ $1 = "staging" ]; then
pm2 restart otp-portal-staging --update-env
else
if pm2 describe otp-portal > /dev/null; then
echo "--> Restarting application"
pm2 restart otp-portal --update-env
else
echo "--> Setting up a new application"
pm2 start index.js --name otp-portal
sudo env PATH=$PATH:/home/ubuntu/.nvm/versions/node/$(node -v)/bin pm2 startup systemd -u ubuntu --hp /home/ubuntu
pm2 save
fi

0 comments on commit 3278fda

Please sign in to comment.