Deploying from GitHub
Every Worker has a repository of its own on Digize, which you push to with a push token (How deploys work). A Worker can deploy from a repository on GitHub instead: each push to its branch there is brought into the Worker’s own repository and built, exactly as a push to it would be, and GitHub shows how each deployment went beside the commit.
Connecting GitHub
Section titled “Connecting GitHub”-
In Settings › Integrations, open GitHub and press Connect, then sign in to GitHub and allow Digize to know who you are.
-
If the Digize app is already installed on your GitHub account or one of your organizations, Digize lists them: choose the one this workspace deploys from, or Install on another account. If it’s installed on none of them, GitHub asks where to install it: your account or an organization, and which repositories it may reach, all of them or a choice. The app needs to read and write the repositories’ contents (the agent’s changes are pushed there), read their metadata, and write commit statuses and pull requests.
-
Back in Digize, the Repositories tab lists what the app reaches. Choose repositories on GitHub opens the installation’s settings there, to add or take away repositories; Digize follows within a moment.
Several workspaces can connect the same GitHub account or organization. A push goes to every workspace connected to it, and each builds the Workers it has linked to that repository. A workspace connects one GitHub account at a time: choosing another one stops pushes from the first reaching this workspace.
Linking a Worker
Section titled “Linking a Worker”A Worker links to one repository and one branch:
- A new Worker: New Worker on a repository in the Repositories tab, or From GitHub on the Workers page. Pick the repository and branch, name the Worker, and its first build starts from the branch’s newest commit.
- An existing Worker: on its Settings tab, the Source section’s Deploy from GitHub. Its branch setting becomes the branch you pick, and the branch’s newest commit builds now.
From the API, POST /api/v1/sites takes a source (repo as owner/name, and a branch, else the repository’s default), PUT /api/v1/sites/{site}/source links a Worker and DELETE /api/v1/sites/{site}/source takes it off. GET /api/v1/github/repos and GET /api/v1/github/branches list what can be picked.
Two Workers can deploy from one repository, such as two apps of a monorepo on the same branch with different root directories.
What a push does
Section titled “What a push does”A push to the Worker’s branch on GitHub queues a deployment, and Digize mirrors the commit into the Worker’s own repository: the commit keeps its hash, so the Worker’s Code tab, its history and its rollbacks show the same commits GitHub does. The build then runs from the mirrored commit as it does for any push, with the Worker’s build settings, variables, secrets and bindings. Pushes to other branches aren’t mirrored or built.
GitHub shows a commit status under digize/<worker> on each commit built: pending while it builds, then success or failure, with a link to the deployment’s log. A pull request against the branch shows it too.
Each deployment’s page links its commit on GitHub. Deploy now builds the branch’s newest commit on GitHub, and Build on push turned off leaves only Deploy now.
The agent’s changes
Section titled “The agent’s changes”When the agent changes a Worker’s code and the Worker deploys from GitHub, an approved change goes to GitHub instead of straight to the Worker’s branch, in one of two ways, chosen by an owner on GitHub’s page in Settings › Integrations under The agent’s changes:
- A pull request (the default). The change’s commits are pushed to a branch of their own,
digize/<change>, and opened as a pull request against the Worker’s branch, with the agent’s summary, the files it touched and a link to the preview, which stays up while the pull request is open. Merging the pull request deploys it: the merge’s push comes in like any push, and the change is watched after as AI › Settings says. Closing it without merging drops the change and deletes the branch. A pull request nobody merges within a month is dropped too. - A push to the branch. The change’s commits are pushed to the Worker’s branch on GitHub and deploy at once, as they would on a Worker with its own repository. Refused if the branch moved since the change was made, in which case ask the agent to make it again.
Either way the change’s card in the chat links the pull request, and the change’s status is pull_request while it waits there (GET /api/v1/site-changes/{id}).
Unlinking
Section titled “Unlinking”Unlink in the Worker’s Source section takes it off GitHub. Its own repository keeps the code as last mirrored, and pushes to it deploy again. Disconnecting GitHub in Settings › Integrations unlinks every Worker; so does removing the Digize app on GitHub, or taking a linked repository away from it, which also tells the workspace’s admins.
Disconnecting from Digize leaves the app installed on GitHub, for connecting again; remove it on GitHub to take its access away.