Use Cloudflare API directly for deployment
This commit is contained in:
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@@ -23,7 +23,7 @@ pipeline {
|
||||
stage('Deploy') {
|
||||
steps {
|
||||
echo 'Deploying to Cloudflare Pages...'
|
||||
sh 'npx wrangler@3 pages deploy docs/.vitepress/dist --project-name=web-home --commit-hash=${GIT_COMMIT} --commit-message="${GIT_COMMIT_MESSAGE}" --commit-dirty=true'
|
||||
sh '''cd docs/.vitepress/dist && tar -czf /tmp/dist.tar.gz * && cd /tmp && curl -s -X POST "https://api.cloudflare.com/client/v4/accounts/0a0b9995a00648aadf505e235e66458a/pages/projects/web-home/deployments" -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" -F "file=@dist.tar.gz" -F "manifest={\\"version\\":1,\\"files\\":{\\"\\":\\"build\\"}}" -F "metadata={\\"branch\\":\\"main\\",\\"commit_hash\\":\\"$GIT_COMMIT\\",\\"skip_caching\\":true}"'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user