Skip to content

Commit

Permalink
changed the vps
Browse files Browse the repository at this point in the history
  • Loading branch information
avaneeshk098 authored Jan 4, 2025
1 parent 7abd11c commit 8db1573
Showing 1 changed file with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
name: Deploy to VPS

on: [push]
on:
push:
branches:
- master

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v1

- name: Copy repository contents via scp
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
source: "."
target: "~/core"

- name: Executing remote commands
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
USERNAME: ${{ secrets.USERNAME }}
PORT: ${{ secrets.PORT }}
KEY: ${{ secrets.SSHKEY }}
script: |
cd /osai-core/core
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
git pull origin main
yarn
pm2 stop osai-core
pm2 del osai-core
pm2 start yarn --name osai-core -- start
- name: Executing remote commands
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
cd ~/core
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
yarn && yarn build
pm2 restart api

0 comments on commit 8db1573

Please sign in to comment.