Deploy your Astro Site to Zerops
هذا المحتوى لا يتوفر بلغتك بعد.
Zerops is a dev-first cloud platform that can be used to deploy an SSR Astro site.
This guide will walk you through deploying an Astro project using the Node.js adapter to Zerops.
Prerequisites
Section titled Prerequisites- An Astro project using the
@astrojs/node
SSR adapter - A Zerops account - If you don’t already have one, you can create a Zerops account for free.
The Zerops x Astro - Node.js example app can be imported directly into your Zerops Dashboard, and deployed in one click!
Creating a Zerops Node.js project
Section titled Creating a Zerops Node.js projectYou can create a Node.js service for your Astro site through the Zerops project add
wizard, or by importing an Astro site using .yaml
.
The following YAML structure will setup a project called my-astro-sites
with a Node.js v20 service called hellothere
. One Zerops project can contain many Astro apps.
Building and deploying your app to Zerops
Section titled Building and deploying your 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 configuring the required build and run operations for the example project with hostname hellothere
:
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.
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: