Skip to content

Commit

Permalink
Update README with instructions to deploy to Deno Deploy (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnauorriols authored Oct 23, 2024
1 parent 1532e4c commit aa8d3d0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,32 @@ This is a Next.js template which can be deployed to [Deno](https://deno.com).

## Deploying to Deno

You can deploy your application to Deno Deploy by connecting your GitHub repository or using the CLI:
To deploy to Deno Deploy, it is recommended to build the Next.js application with "standalone" output. Once the standalone application is built, you can deploy your application to Deno Deploy by connecting your GitHub repository or using the CLI:

1. Install `deployctl`:
```bash
deno install -Arf jsr:@deno/deployctl --global
deployctl deploy
deno install -gArf jsr:@deno/deployctl
```
2. Move the statics not copied into the standalone output directory:
```bash
cp -r public .next/standalone/public
# cp -r .next/static .next/standalone/.next/static
# Deno needs the explicit .cjs extension to interpret the file as CommonJS
mv .next/standalone/server.js .next/standalone/server.cjs
```
3. Deploy
```bash
deployctl deploy --include=.next/standalone .next/standalone/server.cjs
```

For more information, see our [deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying#self-hosting).

## Learn More

To learn more about Next.js, take a look at the following resources:
To learn more about Next.js and Deno Deploy, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
- [Deno Deploy](https://docs.deno.com/deploy/manual/) - Deno Deploy documentation.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
1 change: 1 addition & 0 deletions next.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
output: "standalone",
/* config options here */
};

Expand Down
1 change: 1 addition & 0 deletions public/next.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit aa8d3d0

Please sign in to comment.