title | description | type | i18nReady |
---|---|---|---|
Effettua il deploy del tuo sito Astro su Zerops |
Come effettuare il deploy del tuo sito Astro usando Zerops. |
deploy |
true |
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro' import { Steps } from '@astrojs/starlight/components';
Zerops è una piattaforma cloud oriantata agli sviluppatori che può essere usata per eseguire il deploy del tuo sito SSR Astro.
Questa guida ti accompagnerà nel processo di deployment di un sito Astro su Zerops utilizzando l'adattatore specifico per Node.js.
- Un progetto Astro che usa l'adattatore
@astrojs/node
per il SSR - Un account Zerops - Se non ne hai già uno, puoi creare il tuo account Zerops gratuitamente.
:::tip[Iniziamo da un template] Il Zerops per Astro - esempio per Node.js può essere importato direttamente nella tua Dashboard di Zerops, e distribuito con un clic!
project:
name: astro
services:
- hostname: astronode
type: nodejs@20
buildFromGit: https://github.com/zeropsio/recipe-astro-nodejs
ports:
- port: 4321
httpSupport: true
enableSubdomainAccess: true
minContainers: 1
:::
Puoi creare un servizio Node.js per il tuo sito Astro attraverso il Zerops project add
wizard, o importando un sito Astro usando il .yaml
.
La struttura dello YAML sottostante servirà per creare un progetto chiamato my-astro-sites
con Node.js v20 con l'hostname hellothere
. Un progetto Zerops può contenere più siti Astro.
project:
name: my-astro-sites
services:
- hostname: hellothere
type: nodejs@20
ports:
- port: 4321
httpSupport: true
minContainers: 1
Ora che abbiamo creato un servizio Node.js su Zerops, ti servirà creare il file zerops.yml
nella directory principale del tuo progetto in modo da far avviare il processo di build e deploy alla pipeline di Zerops.
L'esempio sottostante mostra una configurazione che richiede alcune operazioni per il progetto example con l'hostname hellothere
:
Per configurare il processo di build e deploy quando si fa un push a un branch o si crea una nuova release, vai al tuo servizio di Node.js e connetti il servizio di Zerops a una repository GitHub o GitLab.
1. Installa la CLI di Zerops. ```shell # Per scaricare il binario zcli direttamente, # usa https://github.com/zeropsio/zcli/releases npm i -g @zerops/zcli ```-
Vai su
Settings > Access Token Management
nell'app di Zerops e genera un nuovo token per accedere. -
Effetua il login usando il tuo access token usando il comando seguente:
shell zcli login <token>
-
Vai alla directory principale del tuo progetto (dove si trova il
zerops.yml
) e avvia il seguente comando per iniziare il deploy:shell zcli push