summaryrefslogtreecommitdiff
path: root/deploy.sh
diff options
context:
space:
mode:
authorRaphael <mail@raphaelkabo.com>2023-10-08 19:12:44 +0100
committerGitHub <noreply@github.com>2023-10-08 19:12:44 +0100
commit9ef8e220b4fb582d620016d293b340a63ec97cff (patch)
tree15fd6a9ce4921d88c262fbcdfa7c5a67c6be71c4 /deploy.sh
parenta14afed944e5f0b87af96cc5c6a262d246b88d1d (diff)
parentad1ca77aaf9b8700f3341cab1d177e7ab7643048 (diff)
Merge pull request #103 from lowercasename/pm2-ci
Add PM2 deployment config
Diffstat (limited to 'deploy.sh')
-rwxr-xr-xdeploy.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/deploy.sh b/deploy.sh
new file mode 100755
index 0000000..1e78e86
--- /dev/null
+++ b/deploy.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+set -e
+
+# Set up and redeploy Gathio. Called by `pm2 deploy`.
+
+# PM2 doesn't load the user env, so this gets nvm into the PATH
+export NVM_DIR=~/.nvm
+source ~/.nvm/nvm.sh
+# Set the right Node version
+nvm use
+# Need to use `development` here else pnpm won't install devDependencies (i.e. tsc)
+NODE_ENV=development pnpm install
+# This calls `tsc`, which fails due to type errors while we're transitioning
+# fully to TypeScript, so we short-circuit it to true to continue running the
+# deploy script. TODO: Remove this short-circuit when we've migrated to
+# TypeScript and don't expect any more errors.
+pnpm build || true
+pm2 reload ecosystem.config.cjs production
+pm2 save