Skip to content

Merge pull request #20 from DevKor-github/infra/logging #14

Merge pull request #20 from DevKor-github/infra/logging

Merge pull request #20 from DevKor-github/infra/logging #14

Workflow file for this run

# test.yml
name: test branch deploy to ec2
on:
push:
branches:
- test
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build
- name: remote scp commands
uses: appleboy/scp-action@master
with:
host: ${{ secrets.REMOTE_IP }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.REMOTE_PRIVATE_KEY }}
source: 'dist/, package.json, package-lock.json, ecosystem.config.js, prisma/schema.prisma'
target: '/home/ec2-user/Nutripic-back'
- name: remote ssh commands
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_IP }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.REMOTE_PRIVATE_KEY }}
port: ${{ secrets.REMOTE_PORT }}
script: |
cd /home/ec2-user/Nutripic-back
npm install
npm run prisma:dev db push
pm2 restart ecosystem.config.js --env development