Skip to content
This repository was archived by the owner on Nov 2, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/alchemy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# the production deployment. A pull request from this repository deploys the stage
# `pr-<number>`, a preview with that name; closing the pull request destroys the
# stage and deletes the preview. The state of every stage is in the
# `alchemy-state` project of the team, under the stack name GITHUB_REPOSITORY.
# `alchemy-state-store` project of the team, under the stack name GITHUB_REPOSITORY.
# Every run needs only the team token CONVEX_ACCESS_TOKEN; it mints the deploy
# keys itself. Only the Alchemy steps get the secret.
on:
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ create todos, see real-time updates, and scan a QR code to open the same list on
[GitHub CLI](https://cli.github.com/): `CONVEX_ACCESS_TOKEN`, a team access token. Generate it
in the Convex dashboard (the team, **Settings**, **Access Tokens**), copy it, and run
`gh secret set CONVEX_ACCESS_TOKEN`, which asks for the pasted value without showing it. The
token creates the Convex project of the repository, the state project `alchemy-state` of the
token creates the Convex project of the repository, the state project `alchemy-state-store` of the
team, and the short-lived deploy keys of each run. No deploy key is stored anywhere.
5. Push to `main`, or run `alchemy.yml` from the **Actions** tab. The first run creates the project,
named after the repository, with its production deployment, pushes to it, and keeps the state of
the stage `prod` in `alchemy-state`. Each push to `main` deploys from then on, and each pull
the stage `prod` in `alchemy-state-store`. Each push to `main` deploys from then on, and each pull
request deploys the preview `pr-<number>` and comments its URL on the pull request. The run's log
ends with the site URL, `https://<deployment>.convex.site`. When the team has a project with the
name of the repository already, such as one that `pnpm run dev` created, the first run stops: run
Expand Down Expand Up @@ -117,7 +117,7 @@ preview deployment with that name whose URL, `https://<deployment>.convex.site`,
the pull request, and destroys that stage when the pull request closes, all with the team token
`CONVEX_ACCESS_TOKEN`. The stack is named after the repository, `owner/name` (`GITHUB_REPOSITORY`,
or the origin remote on a laptop), and so is its Convex project. Every run, in CI or local, keeps
the state of its stage in the `alchemy-state` project of the team, which the first run creates,
the state of its stage in the `alchemy-state-store` project of the team, which the first run creates,
under the stack name; the stage `prod` owns the project, and `alchemy destroy --stage prod` deletes
it. The state has no lock, so the workflow runs one deploy of a stage at a time. A local run uses
`npx convex login` when `CONVEX_ACCESS_TOKEN` is not set:
Expand Down Expand Up @@ -156,14 +156,14 @@ moves it once:
mutation, signed in with `npx convex login`:

```sh
npx convex run --deployment <team>:alchemy-state:prod state:removeStack "{stack: 'owner/name', stage: 'main'}"
npx convex run --deployment <team>:alchemy-state-store:prod state:removeStack "{stack: 'owner/name', stage: 'main'}"
```

3. Check the stages that are left; the list has `prod` and the `pr-<number>` stages of open pull
requests:

```sh
npx convex run --deployment <team>:alchemy-state:prod state:stages "{stack: 'owner/name'}"
npx convex run --deployment <team>:alchemy-state-store:prod state:stages "{stack: 'owner/name'}"
```

## Important files
Expand Down
2 changes: 1 addition & 1 deletion alchemy.run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Convex Auth keys, uploads the site, and pushes the functions.
//
// The stack is named after the repository, `owner/name`, and its Convex
// project after `name`. The state of every stage is in the `alchemy-state`
// project after `name`. The state of every stage is in the `alchemy-state-store`
// project of the team, which Convex.state() creates on the first run. Every
// run needs the team token CONVEX_ACCESS_TOKEN, or a Convex CLI login
// (`npx convex login`) on a laptop; it mints the deploy keys itself.
Expand Down
Loading