Skip to main content

Deploy an app from GitHub, GitLab or Bitbucket

A Cloider app can deploy straight from a GitHub, GitLab or Bitbucket repository: you connect your git account once, pick a repository and a branch, and Cloider builds the latest commit. With auto deploy on, every push to that branch builds and deploys the next version, with no CI pipeline to write. This page covers connecting each provider, creating the app, auto deploy, manual deploys, changing the branch, and what to do when something goes wrong.

How git deploys work​

A git app remembers its repository, its branch and the connection it reads them through. Each deploy, whether a push or a click, does the same thing:

  1. Cloider asks the provider for the newest commit on the app's branch.
  2. It downloads the repository as an archive at exactly that commit, so a push that lands in the meantime can't change what is built.
  3. It builds and deploys that archive like any other upload. The build records the commit SHA and the first line of its message, so the Builds tab says which commit each version is.
GitHubGitLabBitbucket
Wheregithub.comgitlab.combitbucket.org
How you connectInstall the Cloider GitHub App on your user or organization and choose its repositoriesAuthorize the Cloider application on GitLabAuthorize the Cloider consumer on Bitbucket
What you can importThe repositories the installation can seeProjects you are at least a Reporter onRepositories you can read in your workspaces
How pushes arriveThe GitHub App's webhook, nothing to set upA project webhook Cloider adds when the app is createdA repository webhook Cloider adds when the app is created
Needed for auto deployNothing moreThe Maintainer role on the projectAdmin access to the repository
Repository is matched byRepository idProject idRepository uuid

Self-managed GitLab and Bitbucket Data Center aren't supported.

Before you begin​

  • A Cloider account with a role that can create resources. See Accounts and roles.
  • Your code in a GitHub, GitLab or Bitbucket repository, with at least one commit on the branch you want to deploy.
  • A project Cloider can build: a Dockerfile at the repository root, a project file a buildpack recognizes, or a static site. See Build configuration.
  • For the CLI, install it and log in.

Step 1: Connect your git provider​

Connecting happens in the browser, logged in to the dashboard, because the provider sends you back to the dashboard when you are done. You only do it once per git account.

  1. Open Apps in the sidebar and click Create App.
  2. Under Import a Git repository, click GitHub, GitLab or Bitbucket. A provider you haven't connected yet sends you to its authorization page.
  3. Approve the request:
    • GitHub: authorize the app. If none of your accounts has it installed yet, GitHub then asks where to install it and which repositories it may see. Pick All repositories or only the ones Cloider should deploy.
    • GitLab and Bitbucket: approve Cloider's access request.
  4. You land back on Create App with the import dialog open.

To add another GitHub organization or GitLab or Bitbucket user later, open the import dialog and click Add account.

Installing on a GitHub organization you don't own

When you install the GitHub App on an organization where you aren't an owner, GitHub sends an approval request to the owners instead. The dashboard shows Waiting for approval. Once an owner approves it, open Create App again and the organization is there.

Step 2: Create the app from a repository​

  1. On Create App, click your provider under Import a Git repository.
  2. In the dialog, pick the Account (the GitHub user or organization, or the GitLab or Bitbucket user), then the Repository. Type in Search repositories to filter a long list.
  3. Pick the Branch. It defaults to the repository's default branch, and you can type a branch that isn't listed.
  4. Click Import. Cloider fetches the repository (Fetching your repository...) and reads it (Analyzing your code...).
  5. On Configure your app, check the Deploying from box (repository, branch and commit) and what was detected, then fill in App Name, Port, the optional Start Command and the Subdomain. Add environment variables, build variables or build arguments if the app needs them on its first build.
  6. Click Create App.
The Import from GitHub dialog with the acme account, the acme/api repository and the main branch selected
Pick the account, repository and branch to deploy from.

A git app is created with auto deploy on. The first build starts immediately on the commit that was fetched.

What is imported from the repository?​

Cloider downloads the whole repository at one commit, without its git history, and removes .git, __MACOSX and .DS_Store entries. The archive must be 100 MB or smaller, and 500 MB or smaller once extracted. The build runs at the repository root: a Dockerfile must be at the root to be used, and buildpacks look for project files such as package.json or go.mod at the root. See Monorepos and subfolders.

Auto deploy on push​

With auto deploy on, a push to the app's branch starts a build of the newest commit on that branch. You see it appear on the Builds tab with the commit SHA and message as its source.

Cloider ignores a push when:

  • It is to another branch, or it pushes a tag.
  • It deletes the branch.
  • The app is paused or being deleted. Resume the app and click Deploy latest commit to catch up.
  • A build of the app is already running. The push is skipped, not queued: push again, or click Deploy latest commit once the running build finishes.
  • The account is suspended.
  • The same delivery arrives twice. Providers retry deliveries, and each one builds at most once.

If two of your apps deploy from the same repository and branch, a push builds both.

Auto deploy on GitLab and Bitbucket​

GitHub delivers pushes through the Cloider GitHub App itself. GitLab and Bitbucket don't have that, so Cloider adds a webhook to the project or repository when the app is created, and removes it when the app is deleted or the connection is removed.

Creating that webhook needs the Maintainer role on a GitLab project, or admin access to a Bitbucket repository. If the user who connected the provider doesn't have it, the webhook can't be created and Cloider turns auto deploy off for that app. The app still works: deploy with Deploy latest commit or cloider deploy --git, or ask someone with the right role to connect their account and turn auto deploy back on, which tries to create the webhook again.

Deploy the latest commit manually​

You can build the newest commit of the branch at any time, for example after a skipped push or with auto deploy off.

  1. Open the app and go to the Builds tab.
  2. Click Deploy latest commit.

A git app has no Deploy new version upload button: an upload would be a version the repository knows nothing about, and the next push would replace it.

Change the branch or turn auto deploy off​

The branch and auto deploy are on the app's Settings tab. Changing them doesn't build anything by itself: the next push or the next Deploy latest commit uses them. A branch that doesn't exist isn't checked when you save, it shows up as a failed build on the next deploy.

  1. Open the app and go to the Settings tab.
  2. Under Repository, change Branch, or switch Auto deploy on push on or off.
  3. Click Save changes.

Manage your git connections​

What happens when I disconnect a git account?​

Disconnecting removes the connection on Cloider's side and turns auto deploy off for every app that deploys through it. The apps keep running and remember their repository and branch; their page shows the repository as disconnected and they can't deploy from git until you connect the account again. For GitLab, Cloider also revokes its access token and removes the webhooks it created. For Bitbucket, it removes its webhooks; revoke the grant itself in your Bitbucket account settings. For GitHub, uninstall the Cloider app on GitHub to remove its access.

cloider git disconnect github acme

Connecting the same git account again creates a new connection. Apps that deployed through the removed one keep showing it as disconnected and can't deploy from git any more, so create a new app from the repository, or deploy the old one from your computer with cloider deploy --app. To pause deploys without losing the connection, turn Auto deploy on push off instead.

Changes you make on the provider​

You do this on the providerCloider does this
Rename or transfer the repositoryKeeps deploying it. Repositories are matched by their id, and the new name is picked up from the next push
Remove the repository from the GitHub App's accessTurns auto deploy off for apps deploying from it
Suspend the GitHub App installationTurns auto deploy off for its apps and marks the connection suspended
Unsuspend itClears the suspension. Auto deploy stays off until you turn it on
Uninstall the GitHub AppRemoves the connection, as if you disconnected it
Revoke Cloider's access on GitLab or BitbucketRemoves the connection the next time Cloider tries to use it
Delete the branchThe next deploy fails with a message naming the branch

Can I deploy a subfolder of a monorepo?​

Not directly: Cloider always builds the repository root, and there is no setting for a subdirectory. Two ways around it:

  • Put a Dockerfile at the repository root that copies and builds the subfolder you want:

    Dockerfile
    FROM node:22-alpine
    WORKDIR /app
    COPY services/web/package*.json ./
    RUN npm ci
    COPY services/web/ ./
    RUN npm run build
    CMD ["npm", "start"]
  • Or deploy the subfolder from your computer or CI with cloider deploy services/web. See Deploy from your computer.

Verify​

  • The Builds tab lists a build whose Source is the commit you pushed, and it reaches Ready.
  • The Overview tab shows the repository, branch and commit under Deployed source.
  • cloider app builds api lists the build with the short SHA and commit message.

Troubleshooting​

MessageCause and fix
No repositories to show.GitHub: the installation can only see the repositories you granted it; change them on GitHub. GitLab: you need at least the Reporter role on the project. Bitbucket: you need read access in the workspace
Only the first repositories are listed.The installation sees more than the list can load. Narrow the installation down on GitHub, or use cloider app create --repo with the exact name
This installation is suspended on GitHub. Re-enable it there before importing from it.Unsuspend the Cloider app in the GitHub account or organization settings
We could not read acme/api at main. The branch may be gone, or the repository may have no commits yet.Push a commit to the branch, or pick an existing branch
acme/api is over the 100MB limit.The repository archive is too big. Remove large files from the repository, or deploy a smaller folder with cloider deploy
GitHub no longer gives us acme/api at main (on a build)The branch was deleted or renamed, or the repository was removed from the installation. Change the branch on Settings, or grant access again
The GitLab connection was revoked, reconnect GitLabCloider's access was revoked on GitLab, so the connection was removed. See What happens when I disconnect a git account?
This app's GitHub connection is gone. Reconnect GitHub and try again.The connection is suspended or was removed. Unsuspend a suspended GitHub installation on GitHub. A removed connection can't be restored for an existing app, see What happens when I disconnect a git account?
This app is already building, wait for that build to finish!Only one build runs per app. Wait, then deploy again
This app is paused. Resume it before deploying a new version!Resume the app first, see Pause, resume and delete
Pushes don't deploy a GitLab or Bitbucket appAuto deploy switched itself off because the webhook couldn't be created. Check Auto deploy on push on Settings; see Auto deploy on GitLab and Bitbucket
GitHub importing is not set up on this environment yet.The provider isn't available. Deploy from your computer instead

For build failures after the source is fetched, see Troubleshooting apps.

Next steps​

Frequently asked questions

Does Cloider deploy automatically when I push to GitHub?

Yes. An app created from a GitHub, GitLab or Bitbucket repository has auto deploy on: every push to its branch builds and deploys the newest commit. Pushes to other branches and tag pushes are ignored, and you can turn auto deploy off on the app's Settings tab.

Can I deploy from a private repository?

Yes. Cloider reads private repositories through the connection you authorize: the repositories the Cloider GitHub App can see, GitLab projects you are at least a Reporter on, or Bitbucket repositories you can read.

What happens if I push while a build is running?

The push is skipped, not queued, because an app builds one version at a time. Push again or click Deploy latest commit once the running build finishes.

Why did auto deploy turn itself off on my GitLab app?

Auto deploy on GitLab needs a project webhook, and creating one needs the Maintainer role. If the connected GitLab user lacks it, Cloider turns auto deploy off. Deploy manually, or have a Maintainer connect GitLab and turn auto deploy back on.

Can I deploy a branch other than main?

Yes. Pick any branch when you import the repository, and change it later on the Settings tab or with cloider app git <app> --branch <branch>.

Does Cloider support self-hosted GitLab?

No. Cloider connects to gitlab.com, github.com and bitbucket.org. For a self-hosted git server, deploy from your CI pipeline with cloider deploy.

Can I roll back to an earlier commit?

There is no rollback button. Revert the commit in git and push, or set the app's branch to one that points at the commit you want and click Deploy latest commit.