Skip to content
77 changes: 33 additions & 44 deletions src/content/docs/en/guides/deploy/deno.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Your Astro project is a static site by default. You don’t need any extra confi
To enable on-demand rendering in your Astro project using Deno, and to deploy on Deno Deploy:

<Steps>
1. Install [the `@deno/astro-adapter` adapter][deno-adapter] to your project’s dependencies using your preferred package manager:
1. Install [the `@deno/astro-adapter` adapter][Deno adapter] to your project’s dependencies using your preferred package manager:

<PackageManagerTabs>
<Fragment slot="npm">
Expand Down Expand Up @@ -68,9 +68,10 @@ To enable on-demand rendering in your Astro project using Deno, and to deploy on

3. Update your `preview` script in `package.json` with the change below.

```json del={7} ins={8}
```json del={8} ins={9}
// package.json
{
// ...
"scripts": {
"dev": "astro dev",
"start": "astro dev",
Expand Down Expand Up @@ -126,7 +127,7 @@ You can run your Astro site on your own server, or deploy to Deno Deploy through
</Fragment>
<Fragment slot="yarn">
```shell
yarn install
yarn
```
</Fragment>
</PackageManagerTabs>
Expand Down Expand Up @@ -202,11 +203,11 @@ If your project is stored on GitHub, the [Deno Deploy website](https://dash.deno
- name: Clone repository
uses: actions/checkout@v6

# Not using npm? Change `npm ci` to `pnpm i` or `yarn install`
# Not using npm? Change `npm ci` to `yarn install` or `pnpm i`
- name: Install dependencies
run: npm ci

# Not using npm? Change `npm run build` to `pnpm run build` or `yarn run build`
# Not using npm? Change `npm run build` to `yarn build` or `pnpm run build`
- name: Build Astro
run: npm run build

Expand Down Expand Up @@ -239,11 +240,11 @@ If your project is stored on GitHub, the [Deno Deploy website](https://dash.deno
- name: Clone repository
uses: actions/checkout@v6

# Not using npm? Change `npm ci` to `pnpm i` or `yarn install`
# Not using npm? Change `npm ci` to `yarn install` or `pnpm i`
- name: Install dependencies
run: npm ci

# Not using npm? Change `npm run build` to `pnpm run build` or `yarn run build`
# Not using npm? Change `npm run build` to `yarn build` or `pnpm run build`
- name: Build Astro
run: npm run build

Expand Down Expand Up @@ -308,58 +309,46 @@ If your project is stored on GitHub, the [Deno Deploy website](https://dash.deno

You can track all your deploys on [Deno Deploy](https://dash.deno.com).

4. (Optional) To simplify the build and deploy into one command, add a `deploy-deno` script in `package.json`, adapting it for your preferred package manager.
4. (Optional) To simplify the build and deploy into one command, add a `deploy-deno` script in `package.json`.

<StaticSsrTabs>
<Fragment slot="static">
```json ins={8}
```json ins={9}
// package.json
{
// ...
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"deno-deploy": "npm run build && cd dist && deployctl deploy jsr:@std/http/file-server"
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"deno-deploy": "npm run build && cd dist && deployctl deploy jsr:@std/http/file-server"
}
}
```
</Fragment>
<Fragment slot="ssr">
```json ins={8}
// package.json
{
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "deno run --allow-net --allow-read --allow-env ./dist/server/entry.mjs",
"deno-deploy": "npm run build && deployctl deploy ./dist/server/entry.mjs"
}
}
```
```json ins={9}
// package.json
{
// ...
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "deno run --allow-net --allow-read --allow-env ./dist/server/entry.mjs",
"deno-deploy": "npm run build && deployctl deploy ./dist/server/entry.mjs"
}
}
```
</Fragment>
</StaticSsrTabs>

Then you can use this command to build and deploy your Astro site in one step.

<PackageManagerTabs>
<Fragment slot="npm">
```shell
npm run deno-deploy
```
</Fragment>
<Fragment slot="pnpm">
```shell
pnpm run deno-deploy
```
</Fragment>
<Fragment slot="yarn">
```shell
yarn run deno-deploy
```
</Fragment>
</PackageManagerTabs>
```bash
npm run deno-deploy
```
</Steps>

[deno-adapter]: https://github.com/denoland/deno-astro-adapter
[Deno adapter]: https://github.com/denoland/deno-astro-adapter
Loading
Loading