You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/deploy.mdx
+43-7Lines changed: 43 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,38 +9,74 @@ Once you deploy an app on Kernel, you can schedule its actions on a job or run t
9
9
10
10
## Deploy the app
11
11
12
+
### From local directory
13
+
12
14
Use our CLI from the root directory of your project:
13
15
```bash
14
-
# entrypoint_file_name should be where you've defined your Kernel app
15
16
kernel deploy <entrypoint_file_name>
16
17
```
17
18
19
+
#### Notes
20
+
21
+
- The `entrypoint_file_name` is the file name where you [defined](/apps/develop) your app.
22
+
- Include a `.gitignore` file to exclude dependency folders like `node_modules` and `.venv`.
23
+
24
+
### From GitHub
25
+
26
+
You can deploy an app directly from a public or private GitHub repository using the Kernel CLI — no need to clone or manually push code.
27
+
28
+
```bash
29
+
kernel deploy github \
30
+
--url https://github.com/<owner>/<repo> \
31
+
--ref <branch|tag|commit> \
32
+
--entrypoint <path/to/entrypoint> \
33
+
[--path <optional/subdir>] \
34
+
[--github-token <token>] \
35
+
[--env KEY=value ...] \
36
+
[--env-file .env] \
37
+
[--version latest] \
38
+
[--force]
39
+
```
40
+
41
+
#### Notes
42
+
-**`--path` vs `--entrypoint`:** Use `--path` to specify a subdirectory within the repo (useful for monorepos), and `--entrypoint` for the path to your app's entry file relative to that directory (or repo root if no `--path` is specified).
43
+
- The CLI automatically downloads and extracts the GitHub source code and uploads your app for deployment.
44
+
- For private repositories, provide a `--github-token` or set the `GITHUB_TOKEN` environment variable.
45
+
18
46
## Environment variables
19
47
20
48
You can set environment variables for your app using the `--env` flag. For example:
21
49
22
50
<CodeGroup>
23
-
```bash Typescript/Javascript
51
+
```bash Typescript/Javascript (inline)
24
52
kernel deploy my_app.ts --env MY_ENV_VAR=my_value # Can add multiple env vars delimited by space
25
53
```
26
54
27
-
```bash Python
55
+
```bash Typescript/Javascript (from file)
56
+
kernel deploy my_app.ts --env-file .env
57
+
```
58
+
59
+
```bash Python (inline)
28
60
kernel deploy my_app.py --env MY_ENV_VAR=my_value # Can add multiple env vars delimited by space
29
61
```
62
+
63
+
```bash Python (from file)
64
+
kernel deploy my_app.py --env-file .env
65
+
```
30
66
</CodeGroup>
31
67
32
68
## Deployment notes
33
69
34
-
- The `entrypoint_file_name` is the file name where you [defined](/apps/develop)your app.
35
-
-**The entrypoint file and dependency manifest (`package.json` for JS/TS, `pyproject.toml` for Python) must both be in the root directory of your project.**
36
-
-Include a `.gitignore`file to exclude dependency folders like `node_modules` and `.venv`.
70
+
-**The dependency manifest (`package.json` for JS/TS, `pyproject.toml` for Python) must be present in the root directory of your project.**
-If you encounter a 500 error during deployment, verify that your entrypoint file name and extension are correct (e.g., `app.py` not `app` or `app.js`).
37
73
- Kernel assumes the root directory contains at least this file structure:
38
74
39
75
<CodeGroup>
40
76
```bash Typescript/Javascript
41
77
project-root/
42
78
├─ .gitignore # Exclude dependency folders like node_modules
43
-
├─ my_app.ts # Entrypoint file
79
+
├─ my_app.ts # Entrypoint file (can be located in a subdirectory, e.g. src/my_app.ts)
44
80
├─ package.json
45
81
├─ tsconfig.json # If using TypeScript
46
82
└─ bun.lock | package-lock.json | pnpm-lock.yaml # One of these lockfiles
0 commit comments