Deploy your Astro Site to Zerops
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Zerops is a dev-first cloud platform that can be used to deploy both Static and SSR Astro site.
This guide will walk you through deploying of a static project and Node.js Project to Zerops.
Prerequisites
Section titled Prerequisites- An Astro project using the
@astrojs/node
SSR adapter (for Node.js Project) - zCli zerops cli (optional)
- A Zerops account - If you don’t already have one, you can create a Zerops account for free.
Creating a Zerops Static project
Section titled Creating a Zerops Static projectThe Zerops x Astro - Static example app can be imported directly into your Zerops Dashboard, and deployed in one click!
The following YAML structure will setup a project called recipe-astro with a static service called app.
First create a project using Zerops project add
wizard then create a static service for your Astro project.
Pushing your static app to Zerops
Section titled Pushing your static app to ZeropsNow that you’ve prepared a Static service on Zerops, you will need to create a zerops.yml
file at the root of your project to trigger the build and deploy pipeline on Zerops.
The following example shows the configuration of the required build and operations for the project with hostname app
:
Now you can deploy this using zCli Trigger the pipeline using zcli or you can Or you can import a github/gitlab repository which already has a zerops.yml
One Zerops project can contain multiple Astro apps.
Creating a Zerops Node.js project
Section titled Creating a Zerops Node.js projectThe Zerops x Astro - Node.js example app can be imported directly into your Zerops Dashboard, and deployed in one click!
The following YAML structure will setup a project called recipe-astro with a Node.js v20 service called app.
You can create a Node.js service for your Astro site through the Zerops project add
wizard, or by importing an Astro site using zerops-project-import.yaml
.
Pushing your Node.js app to Zerops
Section titled Pushing your Node.js app to ZeropsNow that you’ve prepared a Node.js service on Zerops, you will need to create a zerops.yml
file at the root of your project to trigger the build and deploy pipeline on Zerops.
The following example shows the configuration of the required build and operations for the project with hostname app
:
Deploying
Section titled DeployingThere are three ways to deploy your astro app in Zerops.
Trigger the pipeline Using Zerops CLI (zcli)
Section titled Trigger the pipeline Using Zerops CLI (zcli)-
Install the Zerops CLI.
-
Open
Settings > Access Token Management
in the Zerops app and generate a new access token. -
Log in using your access token with the following command:
-
Navigate to the root of your app (where
zerops.yml
is located) and run the following command to trigger the deploy:
Trigger the pipeline using GitHub / GitLab
Section titled Trigger the pipeline using GitHub / GitLabTo setup continuous deployment on either a push to a branch or on a new release, go to your Node.js service detail and connect your Zerops service with a GitHub or GitLab repository.
Importing an Existing Project
Section titled Importing an Existing ProjectTo setup continuous deployment on either a push to a branch or on a new release, go to your Node.js service detail and connect your Zerops service with a GitHub or GitLab repository.
-
Importing for Node.js deployment.
-
Importing for Static deployment.
Resources
Section titled Resources- Deploying Astro to Zerops in 3 mins
- Zerops Docs: Detailed guide to creating a Zerops Node.js service