From 13b5991910daa66c4c6ab47f60180e2d378826eb Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Sun, 6 Apr 2025 23:25:40 +0100 Subject: [PATCH] Added jenkins file --- Jenkinsfile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..9e7fd07 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,37 @@ +pipeline { + agent any + + environment { + NODE_ENV = 'production' + CLOUDFLARE_ACCOUNT_ID = credentials('cloudflare-account-id') + CLOUDFLARE_API_TOKEN = credentials('cloudflare-api-token') + PROJECT_NAME = 'tombutcher-cdn' + } + + tools { + nodejs 'Node23' // This should match the name of your NodeJS installation in Jenkins tools + } + + stages { + stage('Checkout') { + steps { + checkout scm // Checkout the repository + } + } + + stage('Deploy to Cloudflare Pages') { + steps { + sh 'npx wrangler pages deploy . --project-name $PROJECT_NAME' + } + } + } + + post { + failure { + echo 'Build or deployment failed.' + } + success { + echo 'Successfully deployed to Cloudflare Pages.' + } + } +}