NoOperation
NoOperation
Explore posts from servers
CDCloudflare Developers
Created by NoOperation on 1/31/2025 in #general-help
Deployment failed via API
Any idea?
37 replies
CDCloudflare Developers
Created by NoOperation on 1/31/2025 in #general-help
Deployment failed via API
There yep
37 replies
CDCloudflare Developers
Created by NoOperation on 1/31/2025 in #general-help
Deployment failed via API
No description
37 replies
CDCloudflare Developers
Created by NoOperation on 1/31/2025 in #general-help
Deployment failed via API
Where is source?
37 replies
CDCloudflare Developers
Created by NoOperation on 1/31/2025 in #general-help
Deployment failed via API
No description
37 replies
CDCloudflare Developers
Created by NoOperation on 1/31/2025 in #general-help
Deployment failed via API
Error: 400 {"result":null,"success":false,"errors":[{"code":8000006,"message":"Request body is incorrect. The request body may have an invalid JSON type or missing required keys. Refer to https://developers.cloudflare.com/api."}],"messages":[]}
37 replies
CDCloudflare Developers
Created by NoOperation on 1/31/2025 in #general-help
Deployment failed via API
Do you mean like this? It does not like source in there.
37 replies
CDCloudflare Developers
Created by NoOperation on 1/31/2025 in #general-help
Deployment failed via API
No description
37 replies
CDCloudflare Developers
Created by NoOperation on 1/31/2025 in #general-help
Deployment failed via API
oh really, let me check
37 replies
CDCloudflare Developers
Created by NoOperation on 1/31/2025 in #general-help
Deployment failed via API
This is what I see after the creation process
37 replies
CDCloudflare Developers
Created by NoOperation on 1/31/2025 in #general-help
Deployment failed via API
No description
37 replies
CDCloudflare Developers
Created by NoOperation on 1/31/2025 in #general-help
Deployment failed via API
It is a Vite project with React.
37 replies
CDCloudflare Developers
Created by NoOperation on 1/31/2025 in #general-help
Deployment failed via API
const body = {
name: gitRepoId,
production_branch: "master",
source: {
type: "github",
config: {
owner: "xxx-labs-projects",
repo_name: getGitRepoNameByGitRepoId(gitRepoId),
},
},
build_config: {
build_caching: true,
build_command: "npm run build",
dev_command: "npm run dev",
destination_dir: "dist",
root_dir: "",
web_analytics_token: "",
wait_for_ci: false
},
deployment_configs: {
production: {
env: {},
compatibility_date: "2025-01-01",
usage_model: "bundled"
},
preview: {
env: {},
compatibility_date: "2025-01-01",
usage_model: "bundled"
}
}
};

const gitRepoName = await getGitRepoNameByGitRepoId(gitRepoId);
const cloudflareProjectName = `${gitRepoId.toString()}-${gitRepoName}`;

const response: Cloudflare.Pages.Projects.Project = await cloudflare.pages.projects.create({
account_id: process.env.CLOUDFLARE_ACCOUNT_ID || '',
name: cloudflareProjectName,
production_branch: "master",
build_config: body.build_config,
deployment_configs: body.deployment_configs,
});
const body = {
name: gitRepoId,
production_branch: "master",
source: {
type: "github",
config: {
owner: "xxx-labs-projects",
repo_name: getGitRepoNameByGitRepoId(gitRepoId),
},
},
build_config: {
build_caching: true,
build_command: "npm run build",
dev_command: "npm run dev",
destination_dir: "dist",
root_dir: "",
web_analytics_token: "",
wait_for_ci: false
},
deployment_configs: {
production: {
env: {},
compatibility_date: "2025-01-01",
usage_model: "bundled"
},
preview: {
env: {},
compatibility_date: "2025-01-01",
usage_model: "bundled"
}
}
};

const gitRepoName = await getGitRepoNameByGitRepoId(gitRepoId);
const cloudflareProjectName = `${gitRepoId.toString()}-${gitRepoName}`;

const response: Cloudflare.Pages.Projects.Project = await cloudflare.pages.projects.create({
account_id: process.env.CLOUDFLARE_ACCOUNT_ID || '',
name: cloudflareProjectName,
production_branch: "master",
build_config: body.build_config,
deployment_configs: body.deployment_configs,
});
37 replies
CDCloudflare Developers
Created by NoOperation on 1/31/2025 in #general-help
Deployment failed via API
Got you
37 replies
CDCloudflare Developers
Created by NoOperation on 1/31/2025 in #general-help
Deployment failed via API
Yes, these are all git repos
37 replies
CDCloudflare Developers
Created by NoOperation on 1/31/2025 in #general-help
Deployment failed via API
Would you need two different API calls in order to trigger a deploy or can I do it with some parameter on init?
37 replies
CDCloudflare Developers
Created by NoOperation on 1/31/2025 in #general-help
Deployment failed via API
The pages project is already created earlier and I need to trigger a deployment when I create it, not after I deploy to my github but only by creating it. I need to auto deploy it on creation. Is this possible, because as of now I do first create it and then try to deploy it (like the code above).
37 replies
CDCloudflare Developers
Created by NoOperation on 1/31/2025 in #general-help
Deployment failed via API
I need to create the pages connected to git via remote (API)
37 replies