diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index b747c11..bf03ecf 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -1,15 +1,18 @@ name: deploy-on-main + on: push: branches: [ "main" ] jobs: deploy: - runs-on: [ linux_amd64, self-hosted ] - steps: - - uses: actions/checkout@v4 + runs-on: [ self-hosted, linux_amd64 ] - - name: Node/PM2/Prisma 확인 + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Node / PM2 / Prisma 확인 run: | node -v npm -v @@ -22,14 +25,11 @@ jobs: run: | set -e cd "$APP_DIR" - git fetch --prune --tags - if [ -n "${GITHUB_SHA:-}" ]; then - git checkout -f "$GITHUB_SHA" - else - git checkout -f main - git reset --hard origin/main - fi - git clean -fdx + # 최신 main 코드 반영 + git fetch origin main + git reset --hard origin/main + + npm ci npm run dbforce 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) \ No newline at end of file