Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 68 additions & 1 deletion docs/guide/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,77 @@ If your CI pipeline runs typechecking or other static analysis before deploy, ru
| `VOID_TOKEN` | Auth token (for CI, skips OAuth) |
| `VOID_PROJECT` | Project slug override |

## GitHub Actions
## GitHub

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.

### Void GitHub App (recommended)

No `.github/workflows/void-deploy.yml` or repository `VOID_TOKEN` is required.

1. Initialize your Void project

```bash
void init
# Or, for existing Void project:
void project link
```

2. Install the Void GitHub app

```bash
void github install
```

You should receive GitHub url asking you to install and authorize `Void Deploy`.

In the browser, select the GitHub account/organization and grant access to the repository.

:::details If someone already installed the App for your organization
Join that installation instead:

```bash
void github join
```

:::

3. Link your repository to your project

```bash
void github connect --executor container
```

4. Verify the connection

```bash
void github status
```

You should receive an output like:

```bash
Repository <owner/repository>
Branch main
Build executor container
Deploy workflow .github/workflows/void-deploy.yml (unused for container builds)

```

5. Push to the configured branch to trigger a new deploy

```bash
git push origin main
```

6. Follow the build

```bash
void build logs --follow

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Wait for the new build before following logs

When the GitHub webhook has not created the new build by the time this command runs, runBuildLogsCommand selects the newest existing build only once (packages/void/src/cli/build-cmd.ts, lines 123–132). Following these consecutive steps can therefore show a previous completed build—or exit with “No builds found”—rather than follow the push from step 5; the instructions should wait until the new build appears or identify that build explicitly.

Useful? React with 👍 / 👎.

```

### GitHub Actions

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**. `void deploy` detects GitHub Actions and does the exchange itself: it requests a short-lived OIDC token from GitHub (audience `void`), 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), and deploys — so the workflow is a single `void deploy` step. `permissions: id-token: write` is still required: it is what lets the job (and the CLI) mint the OIDC token.

```yaml
Expand Down