From 4b2d893905a686aa86240e04db1c55f6b43d98f4 Mon Sep 17 00:00:00 2001 From: openhands Date: Thu, 30 Jul 2026 19:11:58 +0200 Subject: [PATCH] feat: add deploy step in release workflow (build + PM2 restart) and set coverage thresholds to 100 --- .gitea/workflows/deploy.yaml | 23 +++++++++++++++++++++++ vitest.config.ts | 8 ++++---- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 6fef1f7563..20a746ed81 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -10,6 +10,29 @@ jobs: if: startsWith(gitea.ref_name, 'v') runs-on: shell steps: + - name: Build and deploy + env: + VERSION: ${{ gitea.ref_name }} + run: | + set -e + exec 2>&1 + WORK="$(mktemp -d /var/tmp/epicnext-deploy.XXXXXX)" + cleanup() { rm -rf "${WORK}"; } + trap cleanup EXIT + echo "=== Deploying ${VERSION} ===" + git clone --depth 50 \ + /docker/gitea/gitea/git/repositories/remco/epicnext-cms.git \ + "${WORK}" + cd "${WORK}" + git checkout "${VERSION}" + export NODE_ENV=production + export SKIP_ENV_VALIDATION=1 + pnpm install --frozen-lockfile + pnpm prisma:generate + pnpm build + pm2 restart next --update-env + pm2 save + echo "=== Deploy complete ===" - name: Create Release env: VERSION: ${{ gitea.ref_name }} diff --git a/vitest.config.ts b/vitest.config.ts index 86b859b6be..533fed86d0 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -24,10 +24,10 @@ export default defineConfig({ provider: "v8", reporter: ["text", "lcov", "html"], thresholds: { - statements: 5, - branches: 3, - functions: 4, - lines: 5, + statements: 100, + branches: 100, + functions: 100, + lines: 100, }, include: ["src/**/*.{ts,tsx}"], exclude: [