Skip to content

Commit 3c06cf4

Browse files
Update apps/deploy.mdx
1 parent 578fb1f commit 3c06cf4

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

apps/deploy.mdx

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,78 @@ Once you deploy an app on Kernel, you can schedule its actions on a job or run t
99

1010
## Deploy the app
1111

12+
You can deploy your app in two ways: from a local directory or directly from a GitHub repository.
13+
14+
### Deploy from local directory
15+
1216
Use our CLI from the root directory of your project:
1317
```bash
1418
# entrypoint_file_name should be where you've defined your Kernel app
1519
kernel deploy <entrypoint_file_name>
1620
```
1721

22+
### Deploy from GitHub
23+
24+
Deploy directly from a GitHub repository using the API:
25+
26+
<CodeGroup>
27+
```bash Public repository
28+
curl -X POST https://api.kernel.com/v1/deployments \
29+
-H "Authorization: Bearer $KERNEL_API_KEY" \
30+
-H "Content-Type: multipart/form-data" \
31+
-F 'source={
32+
"type": "github",
33+
"url": "https://github.com/org/repo",
34+
"ref": "main",
35+
"entrypoint": "src/app.py"
36+
}' \
37+
-F 'version=1.0.0' \
38+
-F 'env_vars={"FOO": "bar"}'
39+
```
40+
41+
```bash Private repository
42+
curl -X POST https://api.kernel.com/v1/deployments \
43+
-H "Authorization: Bearer $KERNEL_API_KEY" \
44+
-H "Content-Type: multipart/form-data" \
45+
-F 'source={
46+
"type": "github",
47+
"url": "https://github.com/org/private-repo",
48+
"ref": "main",
49+
"entrypoint": "index.ts",
50+
"auth": {
51+
"method": "github_token",
52+
"token": "ghp_your_token_here"
53+
}
54+
}' \
55+
-F 'version=1.0.0'
56+
```
57+
58+
```bash With subpath
59+
curl -X POST https://api.kernel.com/v1/deployments \
60+
-H "Authorization: Bearer $KERNEL_API_KEY" \
61+
-H "Content-Type: multipart/form-data" \
62+
-F 'source={
63+
"type": "github",
64+
"url": "https://github.com/org/monorepo",
65+
"ref": "main",
66+
"path": "apps/api",
67+
"entrypoint": "src/index.ts"
68+
}' \
69+
-F 'version=1.0.0'
70+
```
71+
</CodeGroup>
72+
73+
#### GitHub deployment parameters
74+
75+
- `type`: Must be `"github"`
76+
- `url`: Base repository URL (without `/blob/` or `/tree/` suffixes)
77+
- `ref`: Git branch, tag, or commit SHA to deploy
78+
- `entrypoint`: Relative path to your app entrypoint within the selected path
79+
- `path` (optional): Subdirectory within the repo to deploy (omit to use repo root)
80+
- `auth` (optional): Required for private repositories
81+
- `method`: Must be `"github_token"`
82+
- `token`: GitHub personal access token or installation access token
83+
1884
## Environment variables
1985

2086
You can set environment variables for your app using the `--env` flag. For example:

0 commit comments

Comments
 (0)