Skip to content

Update main.yml

Update main.yml #16

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Nodejs
uses: actions/setup-node@v2
with:
node-version: 20.x
- name: Install Dependencies
run: yarn
- name: Build
run: yarn build
- uses: appleboy/scp-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
port: ${{ secrets.SSH_PORT }}
key: ${{ secrets.SSH_KEY }}
source: "., !node_modules"
target: "~/app/rentx"
- name: Update API
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
port: ${{ secrets.SSH_PORT }}
key: ${{ secrets.SSH_KEY }}
script: |
cd ~/app/rentx
yarn
./node_modules/.bin/typeorm migration:run
pm2 restart rentx