[{"data":1,"prerenderedAt":735,"buildId":736},["ShallowReactive",2],{"-en-guides-deployment":3,"-en-guides-deployment-surround":679,"navigation_docs_en":688},{"id":4,"title":5,"body":6,"description":670,"extension":671,"links":672,"meta":673,"navigation":674,"path":675,"seo":676,"stem":677,"__hash__":678},"docs_en\u002Fen\u002Fguides\u002F4.deployment.md","Deploy a site or Worker",{"type":7,"value":8,"toc":659},"minimark",[9,31,36,59,129,155,177,181,188,255,264,268,272,285,289,308,319,323,339,345,349,374,570,576,586,590,635,642,655],[10,11,12,13,17,18,21,22,25,26],"p",{},"A site built on ",[14,15,16],"code",{},"main"," can deploy as soon as its build succeeds. To tie deployment to a stable release, make it depend on both jobs (",[14,19,20],{},"needs: [build_site, publish]"," in the monorepo example) and pass the tag as ",[14,23,24],{},"release-tag",". ",[27,28,30],"a",{"href":29},"\u002Fen\u002Fexamples\u002Fmonorepo","Monorepo workflows",[32,33,35],"h2",{"id":34},"deployment-permissions","Deployment permissions",[10,37,38,39,42,43,46,47,50,51,54,55,58],{},"Build with ",[14,40,41],{},"check.yml"," and pass its ",[14,44,45],{},"source-sha"," and ",[14,48,49],{},"artifact-id"," to ",[14,52,53],{},"deploy.yml",". Use the same ",[14,56,57],{},"config-file"," for both. Grant write permissions and deployment credentials only to the deploy job.",[60,61,62,78],"table",{},[63,64,65],"thead",{},[66,67,68,72,75],"tr",{},[69,70,71],"th",{},"Provider",[69,73,74],{},"GitHub permissions",[69,76,77],{},"Cloudflare token permissions",[79,80,81,102,114],"tbody",{},[66,82,83,87,99],{},[84,85,86],"td",{},"GitHub Pages",[84,88,89,92,93,92,96],{},[14,90,91],{},"contents: read",", ",[14,94,95],{},"pages: write",[14,97,98],{},"id-token: write",[84,100,101],{},"—",[66,103,104,107,111],{},[84,105,106],{},"Cloudflare Pages",[84,108,109],{},[14,110,91],{},[84,112,113],{},"Pages write access on the target account",[66,115,116,119,123],{},[84,117,118],{},"Cloudflare Workers",[84,120,121],{},[14,122,91],{},[84,124,125,128],{},[14,126,127],{},"Workers Scripts: Edit"," on the target account",[10,130,131,132,46,135,138,139,46,142,145,146,149,150,154],{},"Cloudflare production deployments use ",[14,133,134],{},"CLOUDFLARE_ACCOUNT_ID",[14,136,137],{},"CLOUDFLARE_API_TOKEN"," from repository secrets or organization secrets shared with the repository. Previews use ",[14,140,141],{},"CLOUDFLARE_PREVIEW_ACCOUNT_ID",[14,143,144],{},"CLOUDFLARE_PREVIEW_API_TOKEN"," from the ",[14,147,148],{},"docs-preview"," environment. See ",[27,151,153],{"href":152},"\u002Fen\u002Fguides\u002Fdeployment#manual-cloudflare-workers-previews","manual previews",".",[10,156,157,158,46,161,164,165,168,169,172,173,176],{},"For automatic D1 provisioning, set ",[14,159,160],{},"binding",[14,162,163],{},"database_name"," in ",[14,166,167],{},"d1_databases",", omit ",[14,170,171],{},"database_id"," and grant ",[14,174,175],{},"D1: Edit",". Wrangler reuses the named database or creates it if missing.",[32,178,180],{"id":179},"deployment-policy","Deployment policy",[10,182,183,184,187],{},"Production evaluates ",[14,185,186],{},"artifact.deployment-policy"," after environment protection rules pass and the job holds the concurrency lock.",[60,189,190,204],{},[63,191,192],{},[66,193,194,197,201],{},[69,195,196],{},"Policy",[69,198,199],{},[14,200,24],{},[69,202,203],{},"Deployment condition",[79,205,206,223,238],{},[66,207,208,214,217],{},[84,209,210,213],{},[14,211,212],{},"latest-stable"," (default)",[84,215,216],{},"Required",[84,218,219,220,222],{},"The tag identifies the latest published stable GitHub Release and resolves to ",[14,221,45],{},". An older stable release is skipped.",[66,224,225,230,233],{},[84,226,227],{},[14,228,229],{},"always",[84,231,232],{},"Supplied",[84,234,235,236,154],{},"Any published stable GitHub Release whose tag resolves to ",[14,237,45],{},[66,239,240,244,247],{},[84,241,242],{},[14,243,229],{},[84,245,246],{},"Omitted",[84,248,249,250,252,253,154],{},"Deploy the artifact for ",[14,251,45],{}," without a Release lookup, e.g. on a push to ",[14,254,16],{},[10,256,257,258,260,261,263],{},"Tagged deployments first skip drafts and prereleases. ",[14,259,212],{}," also skips older stable releases. Only then does the job resolve the tag’s commit and compare it with ",[14,262,45],{},". A mismatch or a failed lookup at any required step fails the job.",[32,265,267],{"id":266},"choose-a-provider","Choose a provider",[269,270,86],"h3",{"id":271},"github-pages",[10,273,274,275,277,278,281,282,154],{},"Select ",[14,276,271],{},", set ",[14,279,280],{},"artifact.output-directory"," to the built site and choose GitHub Actions as the source in the repository’s Pages settings. See the ",[27,283,284],{"href":29},"monorepo site workflow",[269,286,288],{"id":287},"cloudflare-pages-direct-upload","Cloudflare Pages Direct Upload",[10,290,291,292,50,295,46,298,301,302,304,305,154],{},"Set ",[14,293,294],{},"artifact.provider",[14,296,297],{},"cloudflare-pages",[14,299,300],{},"project-name"," to an existing Pages project. To deploy from ",[14,303,16],{},", filter for that branch in the caller and set ",[14,306,307],{},"deployment-policy: always",[10,309,310,311,314,315,318],{},"Wrangler uploads the verified ",[14,312,313],{},"payload\u002F"," to production and records the source SHA. A root ",[14,316,317],{},"_worker.js"," file or directory fails validation before upload because Pages treats it as a server entry point.",[269,320,322],{"id":321},"cloudflare-workers-static-assets","Cloudflare Workers static assets",[10,324,325,326,328,329,332,333,92,335,338],{},"Point ",[14,327,280],{}," at the built site. Use a standalone Wrangler JSONC file with ",[14,330,331],{},"assets.directory"," pointing to a subdirectory next to that file. Omit ",[14,334,16],{},[14,336,337],{},"build.command"," and inherited configuration.",[10,340,341,342,344],{},"The deploy job verifies the same-run artifact’s repository, commit and digest, then restores all files, including dotfiles, under ",[14,343,331],{}," in a temporary directory. The official Wrangler Action uploads them with the pinned version, without reinstalling or rebuilding.",[269,346,348],{"id":347},"prebuilt-workers","Prebuilt Workers",[10,350,351,352,355,356,25,360,363,364,25,367,46,370,373],{},"Prebuilt Workers support production only. This ",[14,353,354],{},"artifact"," section uses the ",[27,357,359],{"href":358},"\u002Fen\u002Fexamples\u002Fmonorepo#project-configuration","pnpm project setup",[14,361,362],{},"wrangler-config"," is relative to ",[14,365,366],{},"output-directory",[14,368,369],{},"server\u002F",[14,371,372],{},"public\u002F"," can be siblings.",[375,376,381],"pre",{"className":377,"code":378,"language":379,"meta":380,"style":380},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"component\": \"api\",\n  \"kind\": \"bundle\",\n  \"provider\": \"cloudflare-workers\",\n  \"worker-name\": \"example-api\",\n  \"output-directory\": \".output\",\n  \"wrangler-config\": \"server\u002Fwrangler.json\",\n  \"check-command\": \"pnpm test\",\n  \"build-command\": \"pnpm build\"\n}\n","json","",[14,382,383,392,420,441,462,483,503,523,544,564],{"__ignoreMap":380},[384,385,388],"span",{"class":386,"line":387},"line",1,[384,389,391],{"class":390},"sMK4o","{\n",[384,393,395,398,402,405,408,411,415,417],{"class":386,"line":394},2,[384,396,397],{"class":390},"  \"",[384,399,401],{"class":400},"spNyl","component",[384,403,404],{"class":390},"\"",[384,406,407],{"class":390},":",[384,409,410],{"class":390}," \"",[384,412,414],{"class":413},"sfazB","api",[384,416,404],{"class":390},[384,418,419],{"class":390},",\n",[384,421,423,425,428,430,432,434,437,439],{"class":386,"line":422},3,[384,424,397],{"class":390},[384,426,427],{"class":400},"kind",[384,429,404],{"class":390},[384,431,407],{"class":390},[384,433,410],{"class":390},[384,435,436],{"class":413},"bundle",[384,438,404],{"class":390},[384,440,419],{"class":390},[384,442,444,446,449,451,453,455,458,460],{"class":386,"line":443},4,[384,445,397],{"class":390},[384,447,448],{"class":400},"provider",[384,450,404],{"class":390},[384,452,407],{"class":390},[384,454,410],{"class":390},[384,456,457],{"class":413},"cloudflare-workers",[384,459,404],{"class":390},[384,461,419],{"class":390},[384,463,465,467,470,472,474,476,479,481],{"class":386,"line":464},5,[384,466,397],{"class":390},[384,468,469],{"class":400},"worker-name",[384,471,404],{"class":390},[384,473,407],{"class":390},[384,475,410],{"class":390},[384,477,478],{"class":413},"example-api",[384,480,404],{"class":390},[384,482,419],{"class":390},[384,484,486,488,490,492,494,496,499,501],{"class":386,"line":485},6,[384,487,397],{"class":390},[384,489,366],{"class":400},[384,491,404],{"class":390},[384,493,407],{"class":390},[384,495,410],{"class":390},[384,497,498],{"class":413},".output",[384,500,404],{"class":390},[384,502,419],{"class":390},[384,504,506,508,510,512,514,516,519,521],{"class":386,"line":505},7,[384,507,397],{"class":390},[384,509,362],{"class":400},[384,511,404],{"class":390},[384,513,407],{"class":390},[384,515,410],{"class":390},[384,517,518],{"class":413},"server\u002Fwrangler.json",[384,520,404],{"class":390},[384,522,419],{"class":390},[384,524,526,528,531,533,535,537,540,542],{"class":386,"line":525},8,[384,527,397],{"class":390},[384,529,530],{"class":400},"check-command",[384,532,404],{"class":390},[384,534,407],{"class":390},[384,536,410],{"class":390},[384,538,539],{"class":413},"pnpm test",[384,541,404],{"class":390},[384,543,419],{"class":390},[384,545,547,549,552,554,556,558,561],{"class":386,"line":546},9,[384,548,397],{"class":390},[384,550,551],{"class":400},"build-command",[384,553,404],{"class":390},[384,555,407],{"class":390},[384,557,410],{"class":390},[384,559,560],{"class":413},"pnpm build",[384,562,563],{"class":390},"\"\n",[384,565,567],{"class":386,"line":566},10,[384,568,569],{"class":390},"}\n",[10,571,572,573,575],{},"Package ",[14,574,16],{},", its imported modules and any declared static assets together. If the build emits multiple modules, add module collection rules to the final Wrangler config.",[10,577,578,579,581,582,585],{},"The deploy job verifies the component, artifact kind, config path in the manifest, Worker name and ",[14,580,313],{}," digest. It then runs ",[14,583,584],{},"deploy --no-bundle"," with the pinned Wrangler version in a clean directory.",[32,587,589],{"id":588},"manual-cloudflare-workers-previews","Manual Cloudflare Workers previews",[591,592,593,597,611],"ol",{},[594,595,596],"li",{},"Enable the workers.dev preview URL for a dedicated Worker in a separate Cloudflare preview account.",[594,598,291,599,46,601,603,604,606,607,610],{},[14,600,141],{},[14,602,144],{}," in the ",[14,605,148],{}," GitHub environment. Limit Worker write access to the preview account. Set the repository variable ",[14,608,609],{},"XOVA_DOCS_PREVIEW_WORKER"," to the Worker name.",[594,612,613,614,617,618,621,622,46,624,50,626,628,629,632,633,154],{},"Enter the full commit SHA in the ",[14,615,616],{},"workflow_dispatch"," input. With ",[14,619,620],{},"require-reachable: true",", a repository branch or tag must contain the commit. Pass the build’s ",[14,623,45],{},[14,625,49],{},[14,627,53],{}," with ",[14,630,631],{},"target: preview"," and omit ",[14,634,24],{},[10,636,637,638,641],{},"Check the preview URL and full SHA in the run summary. Previews serve static artifacts only, preserve ",[14,639,640],{},"assets.base_path"," and exclude production routes and bindings. Deployments from one repository to the same preview Worker run in sequence.",[10,643,644,645,647,648,46,651,654],{},"Skip the manual build when the preview variable is unset. A direct call with ",[14,646,631],{}," fails validation if the variable is missing or blank. For multiple sites, assign distinct ",[14,649,650],{},"artifact.component",[14,652,653],{},"artifact-name"," values.",[656,657,658],"style",{},"html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":380,"searchDepth":394,"depth":394,"links":660},[661,662,663,669],{"id":34,"depth":394,"text":35},{"id":179,"depth":394,"text":180},{"id":266,"depth":394,"text":267,"children":664},[665,666,667,668],{"id":271,"depth":422,"text":86},{"id":287,"depth":422,"text":288},{"id":321,"depth":422,"text":322},{"id":347,"depth":422,"text":348},{"id":588,"depth":394,"text":589},"A site built on main can deploy as soon as its build succeeds. To tie deployment to a stable release, make it depend on both jobs (needs: [build_site, publish] in the monorepo example) and pass the tag as release-tag. Monorepo workflows","md",null,{},true,"\u002Fen\u002Fguides\u002Fdeployment",{"title":5,"description":670},"en\u002Fguides\u002F4.deployment","rjyGBeM6YOqqF6Uo1aN0tSMWcKntPi84lclZcSRurfs",[680,684],{"title":681,"path":682,"stem":683,"description":380,"children":-1},"Releasing","\u002Fen\u002Fguides\u002Freleasing","en\u002Fguides\u002F3.releasing",{"title":685,"path":686,"stem":687,"description":380,"children":-1},"release-it configuration","\u002Fen\u002Fguides\u002Frelease-it","en\u002Fguides\u002F5.release-it",[689,702,726],{"title":690,"path":691,"stem":692,"children":693,"page":701},"Examples","\u002Fen\u002Fexamples","en\u002Fexamples",[694,698],{"title":695,"path":696,"stem":697},"From CI downloads to tagged releases","\u002Fen\u002Fexamples\u002Fdownloads","en\u002Fexamples\u002F1.downloads",{"title":699,"path":29,"stem":700},"Monorepo package and documentation site","en\u002Fexamples\u002F2.monorepo",false,{"title":703,"path":704,"stem":705,"children":706,"page":701},"Guides","\u002Fen\u002Fguides","en\u002Fguides",[707,711,715,716,717,718,722],{"title":708,"path":709,"stem":710},"Workflow architecture","\u002Fen\u002Fguides\u002Fproject-workflows","en\u002Fguides\u002F1.project-workflows",{"title":712,"path":713,"stem":714},"Adopt the workflows","\u002Fen\u002Fguides\u002Fadoption","en\u002Fguides\u002F2.adoption",{"title":681,"path":682,"stem":683},{"title":5,"path":675,"stem":677},{"title":685,"path":686,"stem":687},{"title":719,"path":720,"stem":721},"npm publication results","\u002Fen\u002Fguides\u002Fpublication-results","en\u002Fguides\u002F6.publication-results",{"title":723,"path":724,"stem":725},"Workflow and action interfaces","\u002Fen\u002Fguides\u002Farchitecture","en\u002Fguides\u002F7.architecture",{"title":727,"path":728,"stem":729,"children":730,"page":701},"Maintenance","\u002Fen\u002Fmaintenance","en\u002Fmaintenance",[731],{"title":732,"path":733,"stem":734},"Maintain Xova Actions","\u002Fen\u002Fmaintenance\u002Fverification","en\u002Fmaintenance\u002F1.verification",1796537881528,"2d28474e-0c56-4c42-95a6-d293d7783a6d"]