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'