Compare commits
2 Commits
1863121dc2
...
f8557553f9
| Author | SHA1 | Date | |
|---|---|---|---|
| f8557553f9 | |||
| 41d85b4b78 |
49
Jenkinsfile
vendored
Normal file
49
Jenkinsfile
vendored
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
pipeline {
|
||||||
|
agent any
|
||||||
|
|
||||||
|
environment {
|
||||||
|
NODE_ENV = 'production'
|
||||||
|
CLOUDFLARE_ACCOUNT_ID = credentials('cloudflare-account-id')
|
||||||
|
CLOUDFLARE_API_TOKEN = credentials('cloudflare-api-token')
|
||||||
|
PROJECT_NAME = 'tombutcher-web'
|
||||||
|
}
|
||||||
|
|
||||||
|
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('Install dependencies') {
|
||||||
|
steps {
|
||||||
|
sh 'npm install --include dev' // Install project dependencies
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build') {
|
||||||
|
steps {
|
||||||
|
sh 'npm run build' // Build the project
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Deploy to Cloudflare Pages') {
|
||||||
|
steps {
|
||||||
|
sh 'npx wrangler deploy'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
post {
|
||||||
|
failure {
|
||||||
|
echo 'Build or deployment failed.'
|
||||||
|
}
|
||||||
|
success {
|
||||||
|
echo 'Successfully deployed to Cloudflare Pages.'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user