Skip to content

Commit 38a3cf3

Browse files
authored
docs(cloudflare): upload command (#126)
1 parent 2f4df07 commit 38a3cf3

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

pages/cloudflare/caching.mdx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,12 +502,15 @@ export default defineCloudflareConfig({
502502

503503
In order for the cache to be properly initialised with the build-time revalidation data, you need to run a command as part of your deploy step. This should be run as part of each deployment to ensure that the cache is being populated with each build's data.
504504

505-
To populate remote bindings and deploy your application at the same time, you can use the `deploy` command. Similarly, the `preview` command will populate your local bindings and start a Wrangler dev server.
505+
To populate remote bindings and create a new [version](https://developers.cloudflare.com/workers/configuration/versions-and-deployments/#versions) of your application at the same time, you can use either the `deploy` command or the `upload` command. Similarly, the `preview` command will populate your local bindings and start a Wrangler dev server.
506506

507507
```sh
508-
# Populate remote and deploy.
508+
# Populate remote and deploy the worker immediately.
509509
opennextjs-cloudflare deploy
510510

511+
# Populate remote and upload a new version of the worker.
512+
opennextjs-cloudflare upload
513+
511514
# Populate local and start dev server.
512515
opennextjs-cloudflare preview
513516
```

pages/cloudflare/get-started.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,13 @@ Add the following to the scripts field of your `package.json` file:
122122
```json
123123
"preview": "opennextjs-cloudflare build && opennextjs-cloudflare preview",
124124
"deploy": "opennextjs-cloudflare build && opennextjs-cloudflare deploy",
125+
"upload": "opennextjs-cloudflare build && opennextjs-cloudflare upload",
125126
"cf-typegen": "wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts",
126127
```
127128

128129
- `npm run preview`: Builds your app and serves it locally, allowing you to quickly preview your app running locally in the Workers runtime, via a single command.
129-
- `npm run deploy`: Builds your app, and then deploys it to Cloudflare
130+
- `npm run deploy`: Builds your app, and then immediately deploys it to Cloudflare.
131+
- `npm run upload`: Builds your app, and then uploads a new [version](https://developers.cloudflare.com/workers/configuration/versions-and-deployments/#versions) of it to Cloudflare.
130132
- `cf-typegen`: Generates a `cloudflare-env.d.ts` file at the root of your project containing [the types for the `env`](https://developers.cloudflare.com/workers/wrangler/commands/#types).
131133

132134
##### 7. Add caching with Cloudflare R2

0 commit comments

Comments
 (0)