39 lines
873 B
Groovy
39 lines
873 B
Groovy
pipeline {
|
|
agent any
|
|
|
|
environment {
|
|
CLOUDFLARE_API_TOKEN = 'cfut_cYi1Do6CdWPGD8ecrJ6ZtnOMcjU2GI6LdEToDEct71ff4034'
|
|
}
|
|
|
|
stages {
|
|
stage('Install') {
|
|
steps {
|
|
echo 'Installing dependencies...'
|
|
sh 'npm ci && npm install -g wrangler'
|
|
}
|
|
}
|
|
|
|
stage('Build') {
|
|
steps {
|
|
echo 'Building VitePress site...'
|
|
sh 'npm run build'
|
|
}
|
|
}
|
|
|
|
stage('Deploy') {
|
|
steps {
|
|
echo 'Deploying to Cloudflare Pages...'
|
|
sh '/usr/local/bin/wrangler pages deploy docs/.vitepress/dist --project-name=web-home'
|
|
}
|
|
}
|
|
}
|
|
|
|
post {
|
|
success {
|
|
echo 'Deployment successful!'
|
|
}
|
|
failure {
|
|
echo 'Deployment failed!'
|
|
}
|
|
}
|
|
} |