title | description | type | i18nReady |
---|---|---|---|
Astro 사이트를 Zerops에 배포 |
Zerops를 사용하여 Astro 사이트를 웹에 배포하는 방법. |
deploy |
true |
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro' import { Steps } from '@astrojs/starlight/components';
Zerops는 SSR Astro 사이트를 배포하는 데 사용할 수 있는 개발 우선 클라우드 플랫폼입니다.
이 가이드는 Node.js 어댑터를 사용하여 Astro 프로젝트를 Zerops에 배포하는 과정을 안내합니다.
@astrojs/node
SSR 어댑터를 사용하는 Astro 프로젝트- Zerops 계정 - 아직 계정이 없다면 무료로 Zerops 계정을 생성할 수 있습니다.
:::tip[템플릿으로 시작] Zerops x Astro - Node.js 예시 앱을 Zerops 대시보드로 직접 가져와 한 번의 클릭으로 배포할 수 있습니다!
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
:::
Zerops project add
마법사를 통해 또는 .yaml
을 사용하여 Astro 사이트를 가져와 Astro 사이트를 위한 Node.js 서비스를 만들 수 있습니다.
다음 YAML 구조는 hellothere
라는 Node.js v20 서비스를 사용하여 my-astro-sites
라는 프로젝트를 설정합니다. 하나의 Zerops 프로젝트에는 여러 Astro 앱이 포함될 수 있습니다.
project:
name: my-astro-sites
services:
- hostname: hellothere
type: nodejs@20
ports:
- port: 4321
httpSupport: true
minContainers: 1
이제 Zerops에서 Node.js 서비스를 준비했으므로 프로젝트 루트에 zerops.yml
파일을 생성하여 Zerops에서 파이프라인 빌드 및 배포를 트리거해야 합니다.
다음 예시에서는 호스트 이름이 hellothere
인 예시 프로젝트에 필요한 빌드 및 실행 작업을 구성하는 방법을 보여줍니다.
브랜치 푸시 또는 새 릴리스에 대한 지속적인 배포를 설정하려면 Node.js 서비스 세부 정보로 이동하여 Zerops 서비스를 GitHub 또는 GitLab 저장소와 연결하세요.
1. Zerops CLI를 설치합니다. ```shell # zcli 바이너리를 직접 다운로드하려면, # https://github.com/zeropsio/zcli/releases 를 방문하세요. npm i -g @zerops/zcli ```-
Zerops 앱에서
Settings > Access Token Management
를 열고 새 액세스 토큰을 생성합니다. -
다음 명령으로 액세스 토큰을 사용하여 로그인합니다.
shell zcli login <token>
-
앱의 루트 (
zerops.yml
이 있는 위치)로 이동하고 다음 명령을 실행하여 배포를 트리거합니다.shell zcli push