Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 20 additions & 21 deletions docs/2.deploy/20.providers/zerops.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,45 @@

:read-more{title="zerops.io" to="https://zerops.io"}

> [!IMPORTANT]
> 🚧 This preset is currently experimental.

Zerops supports deploying both static and server-side rendered apps with a simple configuration file in your project root.

## Starter templates

If you want to quckly get started with zerops and nitro you can use repositories [`zeropsio/recipe-nitro-nodejs`](https://github.com/zeropsio/recipe-nitro-nodejs) and [`zeropsio/recipe-nitro-static`](https://github.com/zeropsio/recipe-nitro-static) starter templates.

## Project setup

Projects and services can be added either through [project add wizard](https://app.zerops.io/dashboard/project-add) or imported using `zerops-project-import.yml`.
Projects and services can be added through the [Zerops dashboard](https://app.zerops.io) by clicking **Import a project**, or imported using `zerops-project-import.yaml`.

::code-group
```yml [zerops-project-import.yml (node.js)]

```yml [zerops-project-import.yaml (node.js)]
project:
name: nitro-app

services:
- hostname: app
type: nodejs@20
type: nodejs@22
enableSubdomainAccess: true
```
```yml [zerops-project-import.yml (static)]

```yml [zerops-project-import.yaml (static)]
project:
name: nitro-app

services:
- hostname: app
type: static
enableSubdomainAccess: true
```

::

Then create a `zerops.yml` config in your project root:
Then create a `zerops.yaml` config in your project root:

::code-group
```yml [zerops.yml (node.js)]

```yml [zerops.yaml (node.js)]
zerops:
- setup: app
build:
base: nodejs@20
base: nodejs@22
envVariables:
NITRO_PRESET: zerops
buildCommands:
Expand All @@ -56,17 +55,18 @@ zerops:
- package.json
- node_modules
run:
base: nodejs@20
base: nodejs@22
ports:
- port: 3000
httpSupport: true
start: node .output/server/index.mjs
```
```yml [zerops.yml (static)]

```yml [zerops.yaml (static)]
zerops:
- setup: app
build:
base: nodejs@20
base: nodejs@22
envVariables:
NITRO_PRESET: zerops-static
buildCommands:
Expand All @@ -77,11 +77,11 @@ zerops:
run:
base: static
```

::

Now you can trigger the [build & deploy pipeline using the Zerops CLI](#building-deploying-your-app) or by connecting the app service with your [GitHub](https://docs.zerops.io/references/github-integration/) / [GitLab](https://docs.zerops.io/references/gitlab-integration) repository from inside the service detail.


## Build and deploy

Open [Settings > Access Token Management](https://app.zerops.io/settings/token-management) in the Zerops app and generate a new access token.
Expand All @@ -90,11 +90,10 @@ Log in using your access token with the following command:

:pm-x{command="@zerops/zcli login <token>"}

Navigate to the root of your app (where `zerops.yml` is located) and run the following command to trigger the deploy:
Navigate to the root of your app (where `zerops.yaml` is located) and run the following command to trigger the deploy:

:pm-x{command="@zerops/zcli push"}

Your code can be deployed automatically on each commit or a new tag by connecting the service with your [GitHub](https://docs.zerops.io/references/gitlab-integration) / [GitLab](https://docs.zerops.io/references/gitlab-integration) repository. This connection can be set up in the service detail.
Your code can be deployed automatically on each commit or a new tag by connecting the service with your [GitHub](https://docs.zerops.io/references/github-integration/) / [GitLab](https://docs.zerops.io/references/gitlab-integration) repository. This connection can be set up in the service detail.


:read-more{title="Zerops Documentation" to="https://docs.zerops.io/"}
Loading