From 8c3cc2e720fb822bca3660208c34d4a0835ed7ae Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Tue, 9 Jun 2026 14:05:48 -0400 Subject: [PATCH] Update the env --- Jenkinsfile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2765e19..5ef167b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -67,12 +67,15 @@ pipeline { } } - stage('Deploy to Cloudflare') { + stage('Deploy to Cloudflare') { steps { - // Install Wrangler locally for the project - sh 'pnpm add -D wrangler@latest' - // Deploy - sh "pnpm wrangler pages deploy ./.vitepress/dist --project-name=${PRJ_NAME} --branch=main" + script { + def branchArg = env.CHANGE_ID + ? "--branch=pr-${env.CHANGE_ID}" + : "--branch=${env.BRANCH_NAME}" + + sh "pnpm wrangler pages deploy ./dist --project-name=${PRJ_NAME} ${branchArg}" + } } }