From 56ff1962dd88c13826f4798a741d5a6faf58ccca Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Sun, 1 Feb 2026 22:25:36 +0000 Subject: [PATCH] Split ubuntu deploy out into steps. --- Jenkinsfile | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f83aeed..fe06e76 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,11 +1,31 @@ def deploy() { node('ubuntu') { try { - stage('Deploy (Ubuntu)') { + stage('Checkout (Ubuntu)') { checkout scm + } + + stage('Setup Node.js (Ubuntu)') { + nodejs(nodeJSInstallationName: 'Node23') { + sh 'node -v' + sh 'pnpm -v' + } + } + + stage('Install Dependencies (Ubuntu)') { nodejs(nodeJSInstallationName: 'Node23') { sh 'pnpm install --frozen-lockfile --production=false' + } + } + + stage('Build (Ubuntu)') { + nodejs(nodeJSInstallationName: 'Node23') { sh 'NODE_ENV=production pnpm build' + } + } + + stage('Deploy (Ubuntu)') { + nodejs(nodeJSInstallationName: 'Node23') { // Deploy to Cloudflare Pages using wrangler withCredentials([string(credentialsId: 'cloudflare-api-token', variable: 'CLOUDFLARE_API_TOKEN')]) { sh 'pnpm wrangler pages deploy build'