-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploy API server via SSH commands (#42)
Co-authored-by: hiba9201 <[email protected]>
- Loading branch information
1 parent
9ac85cc
commit 9fb7da8
Showing
1 changed file
with
39 additions
and
0 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,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 |