Skip to content

recipes/astro

View source on GitHub

typescript
import '@catapultjs/deploy/recipes/astro'

This recipe runs the Astro build on the server. It does not override deploy:update_code, so combine it with a transfer recipe such as git or rsync.

See the example Astro project for a complete setup, or go directly to deploy.js.

Tasks

TaskInsertedDescription
deploy:installafter deploy:update_codeInstalls dependencies in the release
deploy:buildafter deploy:sharedOverrides the built-in build task and runs astro build

The recipe runs the build command from /.

Configuration

KeyTypeDefaultDescription
astro_pathstring''Sub-path to the Astro app within the repository
source_pathstring''Used as the default value for astro_path
typescript
import { set } from '@catapultjs/deploy'

set('astro_path', 'apps/web')
import '@catapultjs/deploy/recipes/astro'

For standalone server output, make sure your Astro config uses the Node adapter in standalone mode:

typescript
import { defineConfig } from 'astro/config'
import node from '@astrojs/node'

export default defineConfig({
  adapter: node({
    mode: 'standalone',
  }),
})

For static Astro sites built locally, use recipes/astro_static.