Skip to content

Commit

Permalink
Minor: Zerops deployment guide (#781)
Browse files Browse the repository at this point in the history
  • Loading branch information
nermalcat69 authored Aug 8, 2024
1 parent ab12c15 commit 799f768
Show file tree
Hide file tree
Showing 5 changed files with 185 additions and 2 deletions.
7 changes: 7 additions & 0 deletions public/assets/zerops.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion src/routes/guides/deploying-your-app.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Are you ready to deploy your Solid application? Follow our guides for different
href="/guides/deployment-options/netlify"
logo="netlify"
/>
<div />
<ImageLinks
title="Railway"
href="/guides/deployment-options/railway"
Expand All @@ -49,4 +48,9 @@ Are you ready to deploy your Solid application? Follow our guides for different
logo="stormkit"
/>

<ImageLinks
title="Zerops"
href="/guides/deployment-options/zerops"
logo="zerops"
/>
</div>
3 changes: 2 additions & 1 deletion src/routes/guides/deployment-options/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"netlify.mdx",
"railway.mdx",
"vercel.mdx",
"stormkit.mdx"
"stormkit.mdx",
"zerops.mdx"
]
}
170 changes: 170 additions & 0 deletions src/routes/guides/deployment-options/zerops.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
---
title: Zerops
order: 7
mainNavExclude: true
---

import { TabsCodeBlocks } from "~/ui/tab-code-blocks";

[Zerops](https://zerops.io) is a dev-first cloud platform that can be used to deploy both Static and SSR Solid Node.js Apps.

For additional one-to-one support, details, and features, you can join the [Zerops Discord server](https://discord.gg/xxzmJSDKPT) and [visit the Zerops Docs](https://docs.zerops.io).

Deploy and test Zerops Solid recipes with one click:
- [Deploy Solid Node.js & Static Together](https://app.zerops.io/recipe/solidjs) - [Node.js](https://github.com/zeropsio/recipe-solidjs-nodejs) and [Static](https://github.com/zeropsio/recipe-solidjs-static).
- [Deploy Solid Node.js](https://app.zerops.io/recipe/solidjs-nodejs) - [Source Repository](https://github.com/zeropsio/recipe-solidjs-nodejs)
- [Deploy Solid Static](https://app.zerops.io/recipe/solidjs-static) - [Source Repository](https://github.com/zeropsio/recipe-solidjs-static)

## Setting up an Account on Zerops

1. Go to [Zerops Registration](https://app.zerops.io/registration) and sign up using GitHub, GitLab, or just your email.

## Setting up your Project Infrastructure

There are two ways to set up a Zerops project and a service:

#### Using Project Add Wizard (GUI)

1. Go to your [Zerops dashboard](https://app.zerops.io/dashboard/projects).
2. Add a new project using your sidebar. If you're in compact mode, click on your profile and then "Add new project."
3. You'll be redirected to a page where you can choose a service.

##### For Static:
1. Choose Static.
2. Scroll down and change the hostname to your preference.
3. Scroll down and click on the "Add New Static" button.

##### For SSR - Node.js:
1. Choose `Node.js` and select `version 20`.
2. Scroll down and change the hostname to your preference.
3. Scroll down and click on the "Add New Node.js" button.

#### Using Project Import YAML

**Note**: This is only used for project creation using YAML on the web interface—no need to add it to the project.

1. Go to your [Zerops dashboard](https://app.zerops.io/dashboard/projects) and click on your profile icon if you are a new user. If not, check your sidebar and click on `Import Project`.

##### Static:
```yaml
project:
name: recipe-solidjs

services:
- hostname: app
type: static
enableSubdomainAccess: true
```
##### SSR - Node.js:
```yaml
project:
name: recipe-solidjs

services:
- hostname: app
type: nodejs@20
enableSubdomainAccess: true
```
## Add zerops.yml to your repository
The `zerops.yml` configuration file is used to tell Zerops how to build and run your application, it should be placed to the root of your appplication's repository.

Example for **SSR (Server-Side Rendering)** Apps:

Set up the `zerops.yml` file in the root of your SSR project. Make sure the setup parameter's value is the same as the hostname of the service.

```yaml
zerops:
- setup: app
build:
base: nodejs@latest
buildCommands:
- pnpm i
- pnpm build
deployFiles:
- .output
- node_modules
- public
- package.json
run:
base: nodejs@latest
ports:
- port: 3000
httpSupport: true
start: pnpm start
```

Example for **SSG (Static Site Generation)** Apps:

Set up the `zerops.yml` file in the root of your SSG project. Make sure the setup parameter's value is the same as the hostname of the service.

```yaml
zerops:
- setup: app
build:
base: nodejs@latest
buildCommands:
- pnpm i
- pnpm build
deployFiles:
- dist/~
run:
base: static
```
Push the changes to your GitHub/GitLab repository (necessary if you are planning to use GitHub/GitLab).

## Deploying your apps

### Triggering the pipeline automatically by connecting Github/Gitlab repository
You can push your project by [Triggering the pipeline using Zerops CLI](#triggering-the-pipeline-using-githubgitlab) 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.



### Triggering the pipeline manually using Zerops CLI

To download the zCLI binary directly, use [zCLI/releases](https://github.com/zeropsio/zcli/releases) or:
1. Install the Zerops CLI using Terminal.

Linux/MacOS

```bash
curl -L https://zerops.io/zcli/install.sh | sh
```

Windows

```powershell
irm https://zerops.io/zcli/install.ps1 | iex
```

Npm
<TabsCodeBlocks>
<div id="npm">
```bash frame="none"
npm i -g @zerops/zcli
```
</div>
<div id="pnpm">
```bash frame="none"
pnpm add -g @zerops/zcli
```
</div>
<div id="yarn">
```bash frame="none"
yarn global add @zerops/zcli
```
</div>
</TabsCodeBlocks>

2. Open Settings > [Access Token Management](https://app.zerops.io/settings/token-management) in the Zerops app and generate a new access token.
3. Log in using your access token with the following command:
```bash
zcli login <token>
```
4. Navigate to the root of your app (where zerops.yml is located) and run the following command in Terminal to trigger the deploy:
```bash
zcli push
```

Check the official docs if you need more advanced use-cases for [Zerops Docs](http://docs.zerops.io/).
1 change: 1 addition & 0 deletions src/ui/image-links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const logos: { [key: string]: { file: string; style?: string } } = {
netlify: { file: "netlify.svg" },
railway: { file: "railway.svg" },
vercel: { file: "vercel.svg" },
zerops: {file: "zerops.svg"},
sass: { file: "sass.svg" },
less: { file: "less.svg" },
cssmodules: { file: "css-modules.svg", style: "invert" },
Expand Down

0 comments on commit 799f768

Please sign in to comment.