|
| 1 | +--- |
| 2 | +title: Zerops |
| 3 | +order: 7 |
| 4 | +mainNavExclude: true |
| 5 | +--- |
| 6 | + |
| 7 | +import { TabsCodeBlocks } from "~/ui/tab-code-blocks"; |
| 8 | + |
| 9 | +[Zerops](https://zerops.io) is a dev-first cloud platform that can be used to deploy both Static and SSR Solid Node.js Apps. |
| 10 | + |
| 11 | +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). |
| 12 | + |
| 13 | +Deploy and test Zerops Solid recipes with one click: |
| 14 | +- [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). |
| 15 | +- [Deploy Solid Node.js](https://app.zerops.io/recipe/solidjs-nodejs) - [Source Repository](https://github.com/zeropsio/recipe-solidjs-nodejs) |
| 16 | +- [Deploy Solid Static](https://app.zerops.io/recipe/solidjs-static) - [Source Repository](https://github.com/zeropsio/recipe-solidjs-static) |
| 17 | + |
| 18 | +## Setting up an Account on Zerops |
| 19 | + |
| 20 | +1. Go to [Zerops Registration](https://app.zerops.io/registration) and sign up using GitHub, GitLab, or just your email. |
| 21 | + |
| 22 | +## Setting up your Project Infrastructure |
| 23 | + |
| 24 | +There are two ways to set up a Zerops project and a service: |
| 25 | + |
| 26 | +#### Using Project Add Wizard (GUI) |
| 27 | + |
| 28 | +1. Go to your [Zerops dashboard](https://app.zerops.io/dashboard/projects). |
| 29 | +2. Add a new project using your sidebar. If you're in compact mode, click on your profile and then "Add new project." |
| 30 | +3. You'll be redirected to a page where you can choose a service. |
| 31 | + |
| 32 | +##### For Static: |
| 33 | +1. Choose Static. |
| 34 | +2. Scroll down and change the hostname to your preference. |
| 35 | +3. Scroll down and click on the "Add New Static" button. |
| 36 | + |
| 37 | +##### For SSR - Node.js: |
| 38 | +1. Choose `Node.js` and select `version 20`. |
| 39 | +2. Scroll down and change the hostname to your preference. |
| 40 | +3. Scroll down and click on the "Add New Node.js" button. |
| 41 | + |
| 42 | +#### Using Project Import YAML |
| 43 | + |
| 44 | +**Note**: This is only used for project creation using YAML on the web interface—no need to add it to the project. |
| 45 | + |
| 46 | +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`. |
| 47 | + |
| 48 | +##### Static: |
| 49 | +```yaml |
| 50 | +project: |
| 51 | + name: recipe-solidjs |
| 52 | + |
| 53 | +services: |
| 54 | + - hostname: app |
| 55 | + type: static |
| 56 | + enableSubdomainAccess: true |
| 57 | +``` |
| 58 | +
|
| 59 | +##### SSR - Node.js: |
| 60 | +```yaml |
| 61 | +project: |
| 62 | + name: recipe-solidjs |
| 63 | + |
| 64 | +services: |
| 65 | + - hostname: app |
| 66 | + type: nodejs@20 |
| 67 | + enableSubdomainAccess: true |
| 68 | +``` |
| 69 | +
|
| 70 | +## Add zerops.yml to your repository |
| 71 | +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. |
| 72 | + |
| 73 | +Example for **SSR (Server-Side Rendering)** Apps: |
| 74 | + |
| 75 | +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. |
| 76 | + |
| 77 | +```yaml |
| 78 | +zerops: |
| 79 | + - setup: app |
| 80 | + build: |
| 81 | + base: nodejs@latest |
| 82 | + buildCommands: |
| 83 | + - pnpm i |
| 84 | + - pnpm build |
| 85 | + deployFiles: |
| 86 | + - .output |
| 87 | + - node_modules |
| 88 | + - public |
| 89 | + - package.json |
| 90 | + run: |
| 91 | + base: nodejs@latest |
| 92 | + ports: |
| 93 | + - port: 3000 |
| 94 | + httpSupport: true |
| 95 | + start: pnpm start |
| 96 | +``` |
| 97 | + |
| 98 | +Example for **SSG (Static Site Generation)** Apps: |
| 99 | + |
| 100 | +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. |
| 101 | + |
| 102 | +```yaml |
| 103 | +zerops: |
| 104 | + - setup: app |
| 105 | + build: |
| 106 | + base: nodejs@latest |
| 107 | + buildCommands: |
| 108 | + - pnpm i |
| 109 | + - pnpm build |
| 110 | + deployFiles: |
| 111 | + - dist/~ |
| 112 | + run: |
| 113 | + base: static |
| 114 | +``` |
| 115 | +Push the changes to your GitHub/GitLab repository (necessary if you are planning to use GitHub/GitLab). |
| 116 | + |
| 117 | +## Deploying your apps |
| 118 | + |
| 119 | +### Triggering the pipeline automatically by connecting Github/Gitlab repository |
| 120 | +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. |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | +### Triggering the pipeline manually using Zerops CLI |
| 125 | + |
| 126 | +To download the zCLI binary directly, use [zCLI/releases](https://github.com/zeropsio/zcli/releases) or: |
| 127 | +1. Install the Zerops CLI using Terminal. |
| 128 | + |
| 129 | +Linux/MacOS |
| 130 | + |
| 131 | +```bash |
| 132 | +curl -L https://zerops.io/zcli/install.sh | sh |
| 133 | +``` |
| 134 | + |
| 135 | +Windows |
| 136 | + |
| 137 | +```powershell |
| 138 | +irm https://zerops.io/zcli/install.ps1 | iex |
| 139 | +``` |
| 140 | + |
| 141 | +Npm |
| 142 | +<TabsCodeBlocks> |
| 143 | +<div id="npm"> |
| 144 | +```bash frame="none" |
| 145 | +npm i -g @zerops/zcli |
| 146 | +``` |
| 147 | +</div> |
| 148 | +<div id="pnpm"> |
| 149 | +```bash frame="none" |
| 150 | +pnpm add -g @zerops/zcli |
| 151 | +``` |
| 152 | +</div> |
| 153 | +<div id="yarn"> |
| 154 | +```bash frame="none" |
| 155 | +yarn global add @zerops/zcli |
| 156 | +``` |
| 157 | +</div> |
| 158 | +</TabsCodeBlocks> |
| 159 | + |
| 160 | +2. Open Settings > [Access Token Management](https://app.zerops.io/settings/token-management) in the Zerops app and generate a new access token. |
| 161 | +3. Log in using your access token with the following command: |
| 162 | +```bash |
| 163 | +zcli login <token> |
| 164 | +``` |
| 165 | +4. Navigate to the root of your app (where zerops.yml is located) and run the following command in Terminal to trigger the deploy: |
| 166 | +```bash |
| 167 | +zcli push |
| 168 | +``` |
| 169 | + |
| 170 | +Check the official docs if you need more advanced use-cases for [Zerops Docs](http://docs.zerops.io/). |
0 commit comments