컨텐츠로 이동

Deploy your Astro Site to Space

이 컨텐츠는 아직 번역되지 않았습니다.

Deta Space is a personal computer that lives in the cloud — a ‘personal cloud’. You can build and run apps for yourself in your own “Space”. You can publish the apps you’ve built, and they’ll run for people all around the world.

This guide includes step-by-step instructions for building sites in Space. Both static and server-side rendered (with the @astrojs/node adapter) Astro sites are supported.

Prerequisite

To push an Astro site to Space, make sure you first:

Create a Space project inside the directory of your Astro project. Run the CLI and follow the instructions on the screen.

Terminal window
space new

Project Configuration

Static site

Make the following changes to the Spacefile file at the root of your project generated by the Space CLI.

  1. Change the engine to static.
  2. Add Astro’s build command to the list of commands.
  3. Serve the dist directory generated by Astro.
Spacefile
# Spacefile Docs: https://go.deta.dev/docs/spacefile/v0
v: 0
micros:
- name: static-astro-in-space
src: .
engine: static
commands:
- npm run build
serve: dist

Server-side rendered site

Make the following changes to the Spacefile file at the root of your project generated by the Space CLI:

  1. Configure the nodejs16 engine.
  2. Add the build command.
  3. Include the dist directory generated by Astro.
  4. Run the node command.
Spacefile
# Spacefile Docs: https://go.deta.dev/docs/spacefile/v0
v: 0
micros:
- name: ssr-astro-in-space
src: .
engine: nodejs16
commands:
- npm run build
include:
- dist
run: "node ./dist/server/entry.mjs"

How to deploy

Deploy your project with the following command:

Terminal window
space push

This will run the build process and create a new Space app instance where you can access your Astro app.

By default Space apps are private and are only accessible to you.

If you want to make your app available to others you can use Public Routes to make parts of your app public. Or, you can create a release to let others install your app into their own personal cloud.

Next steps

Examples

배포 안내서

더 많은 배포 안내서

배포 타입에 따라 분류