-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
author Raphael <[email protected]> 1688990184 +0000 committer Raphael Kabo <[email protected]> 1696772947 +0100 gpgsig -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEENZJBXR9SBQdfzUlqrBBvvi55RfIFAmUis1MACgkQrBBvvi55 RfKrfwf+JQ6l4aSSW4gIa95N3rlsceOFm0wLN7QUCEeqocHX96kEblCFUYHb5thP GUf5z07XLlAi0pXUhzrK4wajcistv627ObQn3I+XEPdLAqwVAkbcFTdaSBMnSA1/ 8B3Eq/DPxzDCHsdE6ir4q06TPoD42RLSV0fXUaDVyZ3gAXFcZRiDwB/WBf4n8Q3i G/JVP2YiLZBQywkjts+SPrwxS7mTwSGoC/iNVtTP22vmYaqlnr01xXNP49UzwpAb NaVeS89CEUCbVSdt0YNZQXcTzuXDOcPJt6bK3qzpKaqZ3ZoJgDnioB3MW69Qw5oX Fe6wOh88D3NJjmYRY9mugcm7KhWZBw== =JuJT -----END PGP SIGNATURE----- parent aad4162 author Raphael <[email protected]> 1688990184 +0000 committer Raphael Kabo <[email protected]> 1696772914 +0100 gpgsig -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEENZJBXR9SBQdfzUlqrBBvvi55RfIFAmUiszIACgkQrBBvvi55 RfId3wf/aAxsJcAKgpMMxUHquO0NOozk2NjAsxiWdgQHjUlBvRDsV2df03In9Tne ectxJ/z6irC/D+WYwKppIMRduIxOO/GEJb5Y2vYW6VxBg/khp+jgXRXSrVu9CjLg dsgwcmEpsypUnngYxo71YObFe4J7ujjM7lfzRJvqL8LOsWgXMWUNMZG3kFycwMm7 hBv9MFWEwiXrWQwCKeJ3LocAah+Kl7mN4nMQYg1uIyj/u3mZjzQBBLZQJHljI2lk VujuNSBizoKvBl25DKFNt1h9QnBrLH1lPLolglKgWM62iIE823LvMe1XS20LlVyL yYsDdIx+YdXLOtb/Jjphrlv9YCRUZg== =jHTp -----END PGP SIGNATURE----- Add PM2 deployment config
- Loading branch information
1 parent
a14afed
commit a39191f
Showing
5 changed files
with
79 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: CI / Deploy | ||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
|
||
- name: Set up known_hosts file | ||
run: | | ||
mkdir -p ~/.ssh/ && touch ~/.ssh/known_hosts | ||
ssh-keyscan -t rsa ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts | ||
- uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.SSH_KEY }} | ||
|
||
- name: Install PM2 | ||
run: pnpm install -g pm2 | ||
|
||
- name: Deploy | ||
run: pnpm run deploy |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module.exports = { | ||
apps: [ | ||
{ | ||
name: "gathio-prod", | ||
script: "pnpm start", | ||
watch: false, | ||
instances: 1, | ||
autorestart: true, | ||
max_restarts: 10, | ||
max_memory_restart: "512M", | ||
}, | ||
], | ||
|
||
deploy: { | ||
production: { | ||
user: "raphael", | ||
host: "gath.io", | ||
ref: "origin/main", | ||
repo: "[email protected]:lowercasename/gathio", | ||
path: "/home/raphael/gathio-production", | ||
"post-deploy": "./deploy.sh", | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters