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
{{ message }}
Repository navigation
Commit 3f8efcf
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/guide/deployment.md
+37-11Lines changed: 37 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,30 +64,56 @@ If your CI pipeline runs typechecking or other static analysis before deploy, ru
64
64
65
65
## GitHub Actions
66
66
67
-
You can deploy from a GitHub repo with a simple GitHub Actions workflow. Running `void init --github` will generate this as `.github/workflows/deploy.yml` in your project:
67
+
You can deploy from a GitHub repo on every push to `main`. Running `void init --github` generates `.github/workflows/void-deploy.yml` in your project.
68
+
69
+
The workflow authenticates with [GitHub OIDC](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect) — there is **no long-lived `VOID_TOKEN` secret to store or rotate**. The job requests a short-lived OIDC token from GitHub, exchanges it at `POST $VOID_API_URL/auth/github-oidc` for a short-lived project-scoped deploy token (about 15 minutes on the free tier; longer on higher plans, capped at ~60 minutes), then runs `void deploy --project <slug>`:
68
70
69
71
```yaml
70
-
name: Deploy
72
+
name: Deploy to Void
71
73
on:
72
74
push:
73
75
branches: [main]
74
76
77
+
# Latest push wins: a newer commit cancels an in-flight deploy for the same
78
+
# repo + branch, so an older commit can never overtake a newer one.
To get a deploy token, run `void auth token` to copy it to your clipboard, then add it as a GitHub Actions secret.
116
+
Connect the repository to your project once with `void github connect <project> --repo <owner/repo> --executor github_actions` to authorize it. This GitHub Actions path requires the `github_actions` build executor — the default `container` executor will not work with this workflow. The exact steps vary by package manager (the scaffold detects pnpm, yarn, bun, or npm). The `VOID_PROJECT` value is baked in from your linked project when known; otherwise the workflow reads a `VOID_PROJECT` repository variable. To target staging, set a `VOID_API_URL` repository variable to `https://api.staging.void.cloud`.
Copy file name to clipboardExpand all lines: docs/guide/edge/headers.md
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,11 +56,18 @@ Define custom response headers in [`void.json`](../../reference/config) using th
56
56
57
57
## Scope
58
58
59
-
Header rules apply to **all responses** served through the dispatch worker, including static assets, SSR pages, and API routes. They do not apply to:
59
+
Header rules apply to **all responses** served through the dispatch worker, including static assets, SSR pages, API routes, and hashed asset responses (which browsers fetch over `GET` from the immutable edge cache). Serving headers on hashed assets is what lets a cross-origin-isolated app attach `Cross-Origin-Embedder-Policy` and `Cross-Origin-Resource-Policy` to its hashed worker and wasm files — without them, a module worker spawned from a `require-corp` document is blocked.
60
+
61
+
On hashed (content-addressed, immutable) assets, rules are **additive**. You can add headers such as COOP/COEP/CORP or other security headers, but the platform-managed caching, representation, and framing headers are preserved so an immutable asset cannot be mis-cached or corrupted: `Cache-Control`, `Content-Type`, `Content-Encoding`, `Content-Length`, `Content-Range`, `Accept-Ranges`, and `Transfer-Encoding` keep their platform values even if a broad rule tries to overwrite them. (This is the one case where a user `Cache-Control` does not override the default.)
62
+
63
+
Header rules do not apply to:
60
64
61
-
- Hashed asset cache hits (these use immutable caching set by the dispatch worker itself)
62
65
- ISR cache responses (these have their own cache-control headers)
63
66
67
+
### Blocked headers
68
+
69
+
Two headers can never be set through rules: `Set-Cookie` and `Clear-Site-Data`. On the shared `*.void.app` domain, `void.app` is the registrable domain, so a cookie operation from one project would reach every project's subdomain. Both are dropped from rule output to keep that tenant boundary intact.
70
+
64
71
## Framework `_headers` files
65
72
66
73
Meta-frameworks like SvelteKit, Nuxt, and Astro generate a `_headers` file with cache rules for their hashed asset directories. Void automatically parses this file during deploy and merges the rules into the deploy manifest.
@@ -74,6 +81,6 @@ No configuration is needed. If the framework generates a `_headers` file, it is
74
81
75
82
1.`void deploy` reads header rules from the framework `_headers` file (if present) and `routing.headers` in `void.json`, then includes them in the deploy manifest.
76
83
2. The platform stores the rules in the KV routing entry for your project.
77
-
3. The dispatch worker applies matching rules to matching responses before returning them. Cacheable responses are cached with the final headers.
84
+
3. The dispatch worker applies matching rules to matching responses before returning them. Most cacheable responses are cached with the final headers; hashed assets are the exception — their rules are applied on every serve (including cache hits), so a later header-rule change takes effect even when the content hash, and thus the cache entry, is unchanged.
78
85
79
86
Because rules are evaluated at the edge, there is no extra latency cost. Headers are applied inline before the response is returned and cached.
Copy file name to clipboardExpand all lines: docs/reference/cli.md
+65-2Lines changed: 65 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,7 +86,7 @@ After that, the full interactive flow walks through:
86
86
4.**Skills:** links Void skills using the same detected or selected agent context.
87
87
5.**MCP config:** writes MCP server config using that same agent context.
88
88
6.**Demo code:** for existing non-Pages projects, optionally scaffolds a `db/migrations/` directory plus an API route and typed fetch example.
89
-
7.**GitHub Actions:** optionally creates `.github/workflows/deploy.yml`withthe right package manager commands.
89
+
7.**GitHub Actions:** optionally creates `.github/workflows/void-deploy.yml`. The workflow deploys on pushes to `main` and authenticates via [GitHub OIDC](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect) — no long-lived `VOID_TOKEN` secret is stored in the repo. The job requests an OIDC token (audience `void`), exchanges it at `POST $VOID_API_URL/auth/github-oidc` for a short-lived project-scoped deploy token, then runs `void deploy --project <slug>` with the right package manager. The project slug is baked in from your linked project (`.void/project.json`) when known; otherwise the workflow reads a `VOID_PROJECT` repository variable.
90
90
8.**`env.ts` scaffold:** if the project has no `env.ts` but has `.env` / `.env.example` / `.env.local` / `.env.development*` files on disk, generates an `env.ts` pre-populated with their keys. Values get conservative type inference (`boolean`/`url`/`number`/`string`) — the file carries a banner nudging you to tighten anything the heuristic got wrong.
91
91
9.**Project setup:** optionally logs you in, lets you select or create a project, and writes `.void/project.json` so your first deploy can just be `void deploy`.
92
92
@@ -98,10 +98,12 @@ Use flags to run individual steps without prompts:
|`--agents`| Set up agent instructions, skills, and MCP config |
101
-
|`--github`| Only create GitHub Actions workflow |
101
+
|`--github`| Only create the GitHub Actions deploy workflow|
102
102
103
103
Flags can be combined. When any flag is provided, only the specified steps run and interactive prompts are skipped.
104
104
105
+
The `--github` workflow uses GitHub OIDC: you connect the repository to your Void project once with `void github connect <project> --repo <owner/repo> --executor github_actions` (see the GitHub section below), and pushes to `main` deploy automatically. There is no `VOID_TOKEN` secret to create or rotate. To target staging, set a `VOID_API_URL` repository variable to `https://api.staging.void.cloud`.
106
+
105
107
For projects that already have `"extends"`, `void init --tsconfig` preserves the existing config and adds `./.void/tsconfig.json`. If the existing config defines `files` or `compilerOptions.paths`, Void also merges its generated declaration files and aliases into the root config because TypeScript replaces those fields across `extends` instead of deeply merging them.
106
108
107
109
### `void prepare`
@@ -564,6 +566,67 @@ PORT=3000
564
566
565
567
See [Environment Variables](../guide/env-vars.md) for the full guide.
566
568
569
+
## GitHub
570
+
571
+
Deploy-on-GitHub works from **any** Void login — Google, GitHub, or other SSO. The first time you connect GitHub, Void links your GitHub identity to your current account (a one-time step, independent of how you logged in); it never creates a second account.
572
+
573
+
### `void github link`
574
+
575
+
```
576
+
void github link
577
+
```
578
+
579
+
Link your current Void account to a GitHub identity. Opens your browser to authorize Void on GitHub (a localhost + PKCE handshake, the same mechanics as `void auth login`), then binds that GitHub identity to the logged-in account. Requires an authenticated CLI (`void auth login` first).
580
+
581
+
You normally don't need to run this directly — `void github install` runs the link automatically when your account has no GitHub identity yet. Run it on its own to link ahead of time, or to link a GitHub identity without installing the App. If that GitHub account is already linked to a different Void account, the command fails and asks you to use a different GitHub account.
582
+
583
+
### `void github install`
584
+
585
+
```
586
+
void github install
587
+
```
588
+
589
+
Open the GitHub App install page in your browser. If your account has no linked GitHub identity yet, `void github install` first runs the GitHub link automatically (browser authorize), then continues. After installing, run `void github connect` to link a repository to your project.
590
+
591
+
### `void github installations`
592
+
593
+
```
594
+
void github installations
595
+
```
596
+
597
+
List all GitHub App installations linked to your account. Each entry includes the `[id: <installation_id>]` needed for `--installation` in non-interactive use.
598
+
599
+
### `void github connect`
600
+
601
+
```
602
+
void github connect [project] [options]
603
+
```
604
+
605
+
Connect a GitHub repository to a Void project for automatic deploys. On every push to the configured branch, Void builds and deploys your project automatically.
|`--project <name>`| Project name (alias for the positional argument) |
612
+
|`--installation <id>`| GitHub App installation ID (required when you have multiple installations) |
613
+
|`--repo <owner/repo>`| Repository full name — required unless the installation grants exactly one repo |
614
+
|`--branch <name>`| Branch to deploy from — **required in non-interactive mode**|
615
+
|`--executor <type>`| Build executor: `container` (default) or `github_actions`|
616
+
617
+
**Non-interactive use (CI)**
618
+
619
+
When stdin is not a TTY, `void github connect` never prompts — it fails closed and names any flag it needs. `--branch` is always required. `--project` must be resolvable (positional / `--project` / `VOID_PROJECT` / linked `.void/project.json`). `--installation` is required only when your account has more than one installation; otherwise the sole installation is used. `--repo` is required when the installation grants access to all repos or to more than one selected repo; when it grants exactly one repo that repo is used automatically. Use `void github installations` to discover the `installation_id`.
620
+
621
+
```
622
+
void github connect my-app \
623
+
--installation 42 \
624
+
--repo owner/my-app \
625
+
--branch main
626
+
```
627
+
628
+
**Project resolution** follows the same order as deploy: positional / `--project`, `VOID_PROJECT`, linked project (`.void/project.json`).
0 commit comments