This is a template for deploying Astro's Starlight docs (SSG) to Zerops, along with a guide on how to deploy to Zerops using both their GUI and CLI.
Inside of your Astro + Starlight + Zerops project, you'll see the following folders and files:
.
├── public/
├── src/
│ ├── assets/
│ ├── content/
│ │ ├── docs/
│ │ └── config.ts
│ └── env.d.ts
├── astro.config.mjs
├── package.json
├── pnpm-lock.yaml
├── tsconfig.json
└── zerops.yml
Starlight looks for .md
or .mdx
files in the src/content/docs/
directory. Each file is exposed as a route based on its file name.
Images can be added to src/assets/
and embedded in Markdown with a relative link.
Static assets, like favicons, can be placed in the public/
directory.
zerops.yml
used for deploying to zerops via cli or gui.
Deploying Using Zerops Gui - Go to Zerops Dashboard
# You can remove the project parameter if you're importing
# a service into an existing project instead of creating a
# new one
project:
name: zerops-nextjs
services:
- hostname: starlight
type: [email protected]
nginxConfig: |-
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /var/www;
location / {
try_files $uri $uri/ /index.html;
}
access_log syslog:server=unix:/dev/log,facility=local1 default_short;
error_log syslog:server=unix:/dev/log,facility=local1;
}
buildFromGit: https://github.com/nermalcat69/zerops-starlight-ssg
enableSubdomainAccess: true
minContainers: 1
🧑🚀 Confused about how to import? Watch this video about how to import and setup a new project https://youtu.be/ZahXCIaUr_A !
To import into an existing project just go to the existing project and check the left sidebar to import a service(make sure that the project parameter in import yaml).
Deploying Using Zerops Cli - @zeropsio/zcli
git clone https://github.com/nermalcat69/zerops-starlight
pnpm install
pnpm run build
zerops:
- setup: starlight # Service hostname
build:
base: nodejs@18 # Technology used to build the app
buildCommands: # Build commands
- pnpm i
- pnpm run build
deploy: # Build artifacts deployed to the runtime
- dist/~
cache: # Cache for faster next round of build
- node_modules
- pnpm-lock.yaml
Follow these commands to deploy a project to zerops.
Command | Action |
---|---|
zcli login <token> |
Command to login to your zerops account using your token. |
zcli push |
Command to push your codebase to a service (you need to have zerops.yml in your root directory). |
If you still find yourself stuck in the process join Zerops Discord Server or Checkout Zerops Docs.
Check out Starlight’s docs, read the Astro documentation, or jump into the Astro Discord server.