Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Bochkarev committed Sep 7, 2024
2 parents 0c8ab82 + 54b25e7 commit 6c7573c
Show file tree
Hide file tree
Showing 5 changed files with 154 additions and 5 deletions.
9 changes: 9 additions & 0 deletions content/0.index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,15 @@ sections:
- src: /assets/integrations/netlify.svg
alt: Netlify
to: /deploy/netlify
- src: /assets/integrations/koyeb.svg
alt: Koyeb
to: /deploy/koyeb
- src: /assets/integrations/zeabur.svg
alt: zeabur
to: /deploy/zeabur
- src: /assets/integrations/zerops.svg
alt: zerops
to: /deploy/zerops
- src: /assets/integrations/tailwind.svg
alt: Tailwind CSS
to: /modules/tailwindcss
Expand Down
127 changes: 127 additions & 0 deletions content/3.deploy/zerops.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
---
title: Zerops
description: "Deploy your Nuxt Application to Zerops infrastructure."
componentImg: Zerops
logoSrc: "/assets/integrations/zerops.svg"
category: Hosting
NuxtPreset: "zerops"
website: "https://zerops.io"
---

**Nodejs Preset**: `SERVER_PRESET: zerops`
**Static Preset**: `SERVER_PRESET: zerops-static`

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

::tip
**Nuxt x Zerops Quickrun ✨**
:br
Want to test running Nuxt on Zerops without installing or setting up anything? Using repositories [Zerops x Nuxt - Static](https://github.com/zeropsio/recipe-nuxt-static) or [Zerops x Nuxt - SSR on Node.js](https://github.com/zeropsio/recipe-nuxt-nodejs) you can deploy example Nuxt app with a single click.
::


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

## Static

Projects and services can be added either through a [Project add wizard](https://app.zerops.io/dashboard/project-add) or imported using a YAML structure:

### Creating a Project

```yml [zerops-project-import.yml]
project:
name: recipe-nuxt

services:
- hostname: app
type: static
```
This will create a project called `recipe-nuxt` with a Zerops Static service called `app`.

### Setting up Zerops YAML

To tell Zerops how to build and run your app, add a `zerops.yml` to your root:

```yml [zerops.yml]
zerops:
- setup: app
build:
base: nodejs@20
buildCommands:
- yarn
- yarn nuxi generate
deployFiles:
- .output/public/~
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.

## SSR Node.js

Projects and services can be added either through a [Project add wizard](https://app.zerops.io/dashboard/project-add) or imported using a YAML structure:

```yml [zerops-project-import.yml]
project:
name: recipe-nuxt
services:
- hostname: app
type: nodejs@20
```

This will create a project called `recipe-nuxt` with a Zerops Static service called `app`.

### Setting up Zerops YAML

To tell Zerops how to build and run your app, add a `zerops.yml` to your root:

```yml [zerops.yml]
zerops:
- setup: nuxt
build:
base: nodejs@18
prepareCommands:
- node -v
buildCommands:
- yarn
- yarn build
deployFiles:
- .output/~
run:
base: nodejs@18
ports:
- port: 3000
httpSupport: true
start: node server/index.mjs
```

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.


## Building & Deploying your App

- Install the [Zerops CLI](https://github.com/zeropsio/zcli).
```sh
npm i -g @zerops/zcli
```

- Open [Settings > Access Token Management](https://app.zerops.io/settings/token-management) in the Zerops app and generate a new access token.

- Log in using your access token with the following command:

```sh
zcli login <token>
```

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

```sh
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.


:read-more{title="Zerops Documentation" to="https://docs.zerops.io/"}
6 changes: 3 additions & 3 deletions content/4.templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ templates:
description: 'Легкий шаблон Nuxt для сайта, работающего в формате Markdown.'
repo: 'atinux/content-wind'
demo: 'https://content-wind.nuxt.space'
- name: 'Super SaaS'
- name: 'SuperSaaS'
slug: 'supersaas'
description: 'The dashboard system that makes you say WOW.'
description: 'Nuxt 3 Fullstack Starter Kit with Auth, DB, Payment, Files & Emails'
demo: 'https://supersaas.dev/?aff=J0Emk'
purchase: 'https://store.supersaas.dev/?aff=J0Emk'
purchase: 'https://supersaas.dev/?aff=J0Emk'
badge: 'Premium'
- name: 'Tairo'
slug: 'tairo'
Expand Down
3 changes: 1 addition & 2 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ function normalizedDirPath(path?: string) {
return path
}

const windowsPath = path.replace(/\\/g, '/')
return windowsPath.startsWith('file:///') ? windowsPath : `file:///${windowsPath}`
return path.replace(/\\/g, '/')
}

const docsSourceBase = normalizedDirPath(process.env.NUXT_DOCS_PATH)
Expand Down
14 changes: 14 additions & 0 deletions public/assets/integrations/zerops.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1 comment on commit 6c7573c

@vercel
Copy link

@vercel vercel bot commented on 6c7573c Sep 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nuxt-com – ./

nuxt-com-git-main-nuxt-ru.vercel.app
nuxt-com-nuxt-ru.vercel.app

Please sign in to comment.