This commit is contained in:
@@ -1,13 +1,16 @@
|
|||||||
name: deploy-on-main
|
name: deploy-on-main
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "main" ]
|
branches: [ "main" ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: [ linux_amd64, self-hosted ]
|
runs-on: [ self-hosted, linux_amd64 ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Node / PM2 / Prisma 확인
|
- name: Node / PM2 / Prisma 확인
|
||||||
run: |
|
run: |
|
||||||
@@ -22,14 +25,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
cd "$APP_DIR"
|
cd "$APP_DIR"
|
||||||
git fetch --prune --tags
|
# 최신 main 코드 반영
|
||||||
if [ -n "${GITHUB_SHA:-}" ]; then
|
git fetch origin main
|
||||||
git checkout -f "$GITHUB_SHA"
|
|
||||||
else
|
|
||||||
git checkout -f main
|
|
||||||
git reset --hard origin/main
|
git reset --hard origin/main
|
||||||
fi
|
|
||||||
git clean -fdx
|
npm ci
|
||||||
npm run dbforce
|
npm run dbforce
|
||||||
npm run build
|
npm run build
|
||||||
pm2 reload ecosystem.config.js --env production || (pm2 start ecosystem.config.js --env production && pm2 save)
|
pm2 reload ecosystem.config.js --env production || (pm2 start ecosystem.config.js --env production && pm2 save)
|
||||||
Reference in New Issue
Block a user