Skip to content

Commit

Permalink
Deploy API server via SSH commands (#42)
Browse files Browse the repository at this point in the history
Co-authored-by: hiba9201 <[email protected]>
  • Loading branch information
sashachabin and hiba9201 committed Apr 8, 2023
1 parent 9ac85cc commit 9fb7da8
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/api-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: API prod deploy
on:
push:
branches:
- main
paths-ignore:
- README.md
- .gitignore
- .github
- client
jobs:
deploy:
name: Build
runs-on: ubuntu-20.04
steps:
- name: deploy
uses: appleboy/[email protected]
with:
host: ${{ secrets.API_SERVER_HOST }}
username: ${{ secrets.API_SERVER_USERNAME }}
password: ${{ secrets.API_SERVER_PASSWORD }}
script: |
# Fix NVM appleboy/ssh-action
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
cd transport-api-test.na4u.ru/transport
git fetch
git checkout origin/main
export APP_PORT=${{ secrets.API_SERVER_PORT }}
nvm use
pnpm -r --filter transport-server --filter transport-common i
pnpm build:common
pnpm build:server
# Start app (BUG: pm2 not working)
pm2 delete transport-server
pm2 start node api/build/index.js --name transport-server

0 comments on commit 9fb7da8

Please sign in to comment.