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 account.
- Install the Space CLI and log in.
Create a Space project inside the directory of your Astro project. Run the CLI and follow the instructions on the screen.
The Space CLI will try to auto-detect the configuration for your app. Accept the suggested configuration and then follow the instructions below, depending on the type of Astro app you want to deploy.
Project Configuration
Static site
Make the following changes to the Spacefile
file at the root of your project generated by the Space CLI.
- Change the engine to
static
. - Add Astro’s build command to the list of
commands
. - Serve the
dist
directory generated by Astro.
Server-side rendered site
Make the following changes to the Spacefile
file at the root of your project generated by the Space CLI:
- Configure the
nodejs16
engine. - Add the
build
command. - Include the
dist
directory generated by Astro. - Run the node command.
How to deploy
Deploy your project with the following command:
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
- Astro in Space – GitHub