42 lines
903 B
YAML
42 lines
903 B
YAML
name: Build and Deploy
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
deploy-front:
|
|
runs-on: self-hosted
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install front dependencies
|
|
run: cd front && npm ci
|
|
|
|
- name: Build front
|
|
run: cd front && npm run build
|
|
|
|
- name: Deploy front
|
|
run: rsync -a --delete front/dist/ /home/hyoseung/coupon/dist/
|
|
|
|
deploy-back:
|
|
runs-on: self-hosted
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install back dependencies
|
|
run: cd back && npm ci
|
|
|
|
- name: Build back
|
|
run: cd back && npm run build
|
|
|
|
- name: Deploy back
|
|
run: |
|
|
rsync -a --delete back/dist/ /home/hyoseung/coupon/back/dist/
|
|
cd /home/hyoseung/coupon/back
|
|
pm2 restart coupon-back || pm2 start ecosystem.config.js
|
|
pm2 save
|