Providers
Analog supports deployment to many providers with little or no additional configuration using Nitro as its underlying server engine. You can find more providers in the Nitro deployment docs.
Zerops
Zerops is the official deployment partner for AnalogJS.
Analog supports deploying both static and server-side rendered apps to Zerops with a simple configuration file.
One Zerops project can contain multiple Analog projects. See example repositories for static and server-side rendered Analog apps for a quick start.
Static (SSG) Analog app
If your project is not SSG Ready, set up your project for Static Site Generation.
1. Create a project in Zerops
Projects and services can be added either through a Project add wizard or imported using a YAML structure:
project:
name: recipe-analog
services:
- hostname: app
type: static
This creates a project called recipe-analog
with a Zerops Static service called app
.
2. Add zerops.yml configuration
To tell Zerops how to build and run your site, add a zerops.yml
to your repository:
zerops:
- setup: app
build:
base: nodejs@20
buildCommands:
- pnpm i
- pnpm build
deployFiles:
- public
- dist/analog/public/~
run:
base: static
3. Trigger the build & deploy pipeline
Server-side rendered (SSR) Analog app
If your project is not SSR Ready, set up your project for Server Side Rendering.
1. Create a project in Zerops
Projects and services can be added either through a Project add wizard or imported using a YAML structure:
project:
name: recipe-analog
services:
- hostname: app
type: nodejs@20
This creates a project called recipe-analog
with a Zerops Node.js service called app
.
2. Add zerops.yml configuration
To tell Zerops how to build and run your site, add a zerops.yml
to your repository:
zerops:
- setup: app
build:
base: nodejs@20
buildCommands:
- pnpm i
- pnpm build
deployFiles:
- public
- node_modules
- dist
run:
base: nodejs@20
ports:
- port: 3000
httpSupport: true
start: node dist/analog/server/index.mjs
3. Trigger the build & deploy pipeline
Build & deploy your code
Trigger the pipeline by connecting the service with your GitHub / GitLab repository
Your code can be deployed automatically on each commit or a new tag by connecting the service with your GitHub / GitLab repository. This connection can be set up in the service detail.
Trigger the pipeline using Zerops CLI (zcli)
You can also trigger the pipeline manually from your terminal or your existing CI/CD by using Zerops CLI.
- Install the Zerops CLI.
# To download the zcli binary directly,
# use https://github.com/zeropsio/zcli/releases
npm i -g @zerops/zcli
-
Open Settings > Access Token Management in the Zerops app and generate a new access token.
-
Log in using your access token with the following command:
zcli login <token>
- Navigate to the root of your app (where
zerops.yml
is located) and run the following command to trigger the deploy:
zcli push