-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
202 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
--- | ||
title: Despliega tu sitio de Astro en Zerops | ||
description: Cómo desplegar tu sitio de Astro en la web usando Zerops. | ||
type: deploy | ||
i18nReady: true | ||
--- | ||
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro' | ||
import { Steps } from '@astrojs/starlight/components'; | ||
|
||
[Zerops](https://zerops.io/) es una plataforma en la nube centrada en el desarrollo que se puede utilizar para desplegar un sitio Astro SSR. | ||
|
||
Esta guía te guiará a través del despliegue de un proyecto de Astro utilizando el adaptador Node.js en Zerops. | ||
|
||
## Prerrequisitos | ||
|
||
- **Un proyecto de Astro usando el [adaptador SSR `@astrojs/node`](/es/guides/integrations-guide/node/)** | ||
- **Una cuenta de Zerops** - Si aún no tienes una, puedes [crear una cuenta de Zerops](https://zerops.io/) de forma gratuita. | ||
|
||
:::tip[Comienza desde una plantilla] | ||
¡El [ejemplo de aplicación Zerops x Astro - Node.js](https://github.com/zeropsio/recipe-astro-nodejs) se puede importar directamente en tu [Panel de Zerops](https://app.zerops.io/dashboard/projects) y desplegar en un solo clic! | ||
|
||
```yaml | ||
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 | ||
``` | ||
::: | ||
## Crear un proyecto de Node.js en Zerops | ||
Puedes crear un servicio Node.js para tu sitio Astro a través del [asistente `project add` de Zerops](https://app.zerops.io/dashboard/project-add) o importando un sitio Astro usando `.yaml`. | ||
|
||
La siguiente estructura YAML configurará un proyecto llamado `my-astro-sites` con un servicio Node.js v20 llamado `hellothere`. Un proyecto de Zerops puede contener muchas aplicaciones Astro. | ||
|
||
```yaml | ||
project: | ||
name: my-astro-sites | ||
services: | ||
- hostname: hellothere | ||
type: nodejs@20 | ||
ports: | ||
- port: 4321 | ||
httpSupport: true | ||
minContainers: 1 | ||
``` | ||
|
||
|
||
## Construir y desplegar tu aplicación en Zerops | ||
|
||
Ahora que has preparado un servicio Node.js en Zerops, necesitarás crear un archivo `zerops.yml` en la raíz de tu proyecto para activar el proceso de compilación y despliegue en Zerops. | ||
|
||
El siguiente ejemplo muestra la configuración de las operaciones de construcción y ejecución necesarias para el proyecto de ejemplo con el nombre de host `hellothere`: | ||
|
||
<PackageManagerTabs> | ||
<Fragment slot="npm"> | ||
```yaml title="zerops.yml" | ||
zerops: | ||
- setup: hellothere | ||
build: | ||
base: nodejs@20 | ||
buildCommands: | ||
- npm i | ||
- npm run build | ||
deploy: | ||
- dist | ||
- package.json | ||
- node_modules | ||
cache: | ||
- node_modules | ||
- package-lock.json | ||
run: | ||
start: node dist/server/entry.mjs | ||
envVariables: | ||
HOST: 0.0.0.0 | ||
NODE_ENV: production | ||
``` | ||
</Fragment> | ||
<Fragment slot="pnpm"> | ||
```yaml title="zerops.yml" | ||
zerops: | ||
- setup: hellothere | ||
build: | ||
base: nodejs@20 | ||
buildCommands: | ||
- pnpm i | ||
- pnpm run build | ||
deploy: | ||
- dist | ||
- package.json | ||
- node_modules | ||
cache: | ||
- node_modules | ||
- pnpm-lock.json | ||
run: | ||
start: node dist/server/entry.mjs | ||
envVariables: | ||
HOST: 0.0.0.0 | ||
NODE_ENV: production | ||
``` | ||
</Fragment> | ||
<Fragment slot="yarn"> | ||
```yaml title="zerops.yml" | ||
zerops: | ||
- setup: astronode | ||
build: | ||
base: nodejs@20 | ||
buildCommands: | ||
- yarn | ||
- yarn build | ||
deploy: | ||
- dist | ||
- package.json | ||
- node_modules | ||
cache: | ||
- node_modules | ||
- yarn.lock | ||
run: | ||
start: node dist/server/entry.mjs | ||
envVariables: | ||
HOST: 0.0.0.0 | ||
NODE_ENV: production | ||
``` | ||
</Fragment> | ||
</PackageManagerTabs> | ||
|
||
### Desencadenar el pipeline usando GitHub / GitLab | ||
Para configurar el despliegue continuo en una rama o en un nuevo lanzamiento, ve a los detalles del servicio Node.js y conecta tu servicio de Zerops con un repositorio de GitHub o GitLab. | ||
|
||
|
||
### Desencadenar el pipeline usando Zerops CLI (zcli) | ||
|
||
<Steps> | ||
1. Instala la CLI de Zerops. | ||
```shell | ||
# Para descargar el binario de zcli directamente, | ||
# usa https://github.com/zeropsio/zcli/releases | ||
npm i -g @zerops/zcli | ||
``` | ||
|
||
2. Abre [`Settings > Access Token Management`](https://app.zerops.io/settings/token-management) en la aplicación de Zerops y genera un nuevo token de acceso. | ||
|
||
3. Inicia sesión usando tu token de acceso con el siguiente comando: | ||
```shell | ||
zcli login <token> | ||
``` | ||
|
||
4. Navega a la raíz de tu aplicación (donde se encuentra `zerops.yml`) y ejecuta el siguiente comando para desencadenar el despliegue: | ||
```shell | ||
zcli push | ||
``` | ||
</Steps> | ||
|
||
## Recursos | ||
|
||
- [Desplegando Astro a Zerops en 3 minutos](https://medium.com/@arjunaditya/how-to-deploy-astro-to-zerops-4230816a62b4) | ||
- [Guía detallada para crear un servicio Node.js en Zerops](https://docs.zerops.io/nodejs/how-to/create) |
15 changes: 15 additions & 0 deletions
15
src/content/docs/ko/reference/errors/actions-without-server-output-error.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: Actions must be used with server output. | ||
i18nReady: true | ||
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts | ||
--- | ||
|
||
> **ActionsWithoutServerOutputError**: Actions enabled without setting a server build output. A server is required to create callable backend functions. To deploy routes to a server, add a server adapter to your astro config. | ||
## 무엇이 잘못되었나요? | ||
Actions를 사용하여 백엔드 함수를 생성하려면 프로젝트에 서버 출력이 있어야 합니다. | ||
|
||
**더 보기:** | ||
- [요청 시 렌더링](/ko/basics/rendering-modes/#요청-시-렌더링) | ||
|
||
|
16 changes: 16 additions & 0 deletions
16
src/content/docs/ko/reference/errors/prerender-client-address-not-available.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
title: Astro.clientAddress cannot be used inside prerendered routes. | ||
i18nReady: true | ||
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts | ||
--- | ||
|
||
> **PrerenderClientAddressNotAvailable**: `Astro.clientAddress` cannot be used inside prerendered routes | ||
## 무엇이 잘못되었나요? | ||
`Astro.clientAddress` 속성은 사전 렌더링된 경로에서 사용할 수 없습니다. | ||
|
||
**더 보기:** | ||
- [사전 렌더링 선택](/ko/guides/server-side-rendering/#server-모드에서-사전-렌더링-선택) | ||
- [Astro.clientAddress](/ko/reference/api-reference/#astroclientaddress) | ||
|
||
|