Docs/Deploy/Deploy from GitHub

Deploy from GitHub

4 min read
On this page

Connect a GitHub repository to a project and Dokwe builds and deploys every push to the branch you choose. This page covers the first setup, how auto-deploy works, and how to change the repository later.

Create a project from a repository#

  1. Connect GitHub#

    Open New project. If your workspace has no GitHub account yet, select Connect GitHub. Dokwe needs the connection to list your repositories and to install the webhook for you. You can connect more than one account with Add account.

  2. Pick the repository#

    Choose a repository from Select a repository…, or select Enter URL manually → and paste a URL such as https://github.com/org/repo.

  3. Fill in the project details#

    Set the Project name, Branch (the branch Dokwe deploys, main by default), Slug, and, for monorepos, the Root directory to build from (for example apps/api).

  4. Choose a deploy target and mode#

    Under Deploy target, keep Dokwe Platform or pick one of your online servers. Choose Container or Native mode. See Container or native.

  5. Deploy#

    Select Deploy project. Dokwe creates the project, a pipeline with Staging and Production environments, an auto-domain, and a webhook on the repository.

Dokwe installs the webhook on a best-effort basis. If it couldn't, the project is still created. Use Repair Webhook on the project overview to install it again.

How auto-deploy works#

When you push, GitHub sends a push event to Dokwe. Dokwe then:

  1. Ignores tag pushes and branch deletions.
  2. Finds the project whose repository and branch match the push. Pushes to other branches are ignored.
  3. Rejects the request unless it carries a valid X-Hub-Signature-256 signature made with the project's webhook secret.
  4. Skips the deploy if auto-deploy is paused for the project.
  5. Creates a deployment for the pushed commit and starts the build.

The deployment lands in the environment that tracks the project branch, which is Staging in the default pipeline. To put it on production, promote it. See Staging and production.

Pause auto-deploy#

Open the project Settings and turn off Auto-deploy on push. Dokwe keeps accepting and verifying webhooks but doesn't build anything. Manual deploys from the Deploy button and rollbacks still work.

Set up the webhook yourself#

The Webhook section of the project Settings shows the webhook URL and the secret. Add both to your repository's webhook settings on GitHub if you need to configure it by hand.

Change the repository#

If you picked the wrong repository, or the code moved, you can point the project at a different one without recreating it.

  1. Open the source repository settings#

    Go to the project Settings and find Source repository. Select Change repository.

  2. Pick the new repository and branch#

    Choose the new repository in the picker, then select Review change.

  3. Confirm#

    Read the summary and select Confirm — switch to this repo. The next deploy builds from the new source.

  4. Add the webhook to the new repository#

    Add the Dokwe webhook from the Webhook section to the new repository so auto-deploy keeps working.

When you change the repository, Dokwe:

  • Rotates the project's webhook secret, so the old repository's webhook stops triggering deploys.
  • Keeps your deployment history. Older entries still reference commits from the previous repository.
  • Refuses the change while any environment has a queued or building deployment. Wait for it to finish, or cancel it, then try again.

When the workspace can't reach the repository#

Dokwe checks whether your workspace's GitHub connection can clone the project's repository. If it can't, the project page shows a Source repository unreachable banner. The banner gives one of two reasons:

  • SSO authorization needed. A GitHub account is connected, but the repository belongs to an organization that enforces SAML SSO. Authorize the token for that organization on GitHub.
  • No access. No GitHub account in this workspace can clone the repository. This often happens after a project is transferred from a workspace that used a different GitHub account. Connect an account that has access.

You can also fix it from the banner. Pick a repository the workspace can access, select Review change, then Change repository. This is the same repository swap described above, so it rotates the webhook secret too.

Projects deployed with the CLI don't show this banner, because their code lives on Dokwe's git server instead of GitHub. See Deploy with the CLI.

If a deploy runs on your own server and the access check fails, Dokwe still tries the clone and adds a warning with the likely fix to the build log.