Git & deploy·4 min read

Linking your GitHub account to your hosting account

Link your GitHub account once with a code. After that the assistant and the terminal create repositories, push your work and open pull requests. Plus how it differs from a deploy key.

Create a private repository for this website, put the current files in it
and push to main.

This request only works once your hosting account knows who you are on GitHub. You arrange that once, with a six character code, and from then on both the Invoker Assistant and the terminal can work with your repositories. This article walks through the linking and explains how it differs from a deploy key, because those are two different things that are easy to mix up.

Linking, in three minutes

  1. In DirectAdmin open Invoker Link and go to the GitHub tab. The GitHub account block is at the top.
  2. Click Link GitHub. A code appears under "Your code".
  3. Click Open GitHub. A new tab opens on github.com. Sign in there with your own GitHub account and type the code.
  4. Confirm on GitHub that you are granting access. Leave the DirectAdmin tab open: that page notices by itself and continues.

You then see Linked as @yourname, together with the access that was granted. The code is valid for fifteen minutes. If it is not confirmed within that time you get a message saying the login stopped before the code was confirmed, and you simply start again.

Your password never reaches the server. You sign in with GitHub itself; the server only gets back an access token that belongs to your account.

The link asks GitHub for three things: access to your repositories, to workflows, and permission to see your organisation membership. In practice that means:

  • The assistant and the terminal can create a new repository for a website, public or private.
  • git push works without you entering credentials every time.
  • The gh command is signed in, so issues, pull requests and releases are possible from your hosting account.

You do not have to run gh auth login in the terminal yourself; linking already did that. You can revoke access on the GitHub side at any time under Settings → Applications, and on our side with the Unlink button on the same tab.

This is where most of the confusion lives. There are two kinds of links and they do different things.

Linking your GitHub account Linking a repository to a website
What it is Your account, once, for the whole hosting account One deploy key per repository, per website
What for Creating repositories, pushing, pull requests, gh Putting code from a repository on your website
Direction From the server to GitHub From GitHub to the server
Rights Read and write in your repositories Read only, in that one repository
Deploys automatically No Yes, through the webhook on every push

If you want every push to main to update your website, you need the second one: see Linking a GitHub repository to your website. If you want the assistant to put code on GitHub for you, you need the first. In practice you often use both: the assistant creates the repository and pushes the first version, and then you set that repository as the deploy source for your website.

Worth knowing: if you unlink your GitHub account, linked repositories keep working. They hang on their own deploy key, not on your login.

What the assistant does with it

After linking, the assistant knows GitHub is available. That is part of the account facts it receives at the start of every chat, so you do not have to explain it. Requests that start making sense:

Put today's changes on a new branch and open a pull request with a short
description of what changed.
Create a repository with just my theme in it, not the whole WordPress folder.

The second one is deliberate: putting an entire WordPress installation under version control is rarely what you want. A theme or a plugin is.

Common mistakes

"I linked GitHub, but my site does not update after a push." You were looking for the other link. Linking the account gives the assistant access to GitHub; for automatic deploys you link a repository to the website.

"I signed in with my client's GitHub account." The link applies to the whole hosting account, so sign in with the account that holds your repositories. If you work for clients with separate organisations, grant that organisation access instead of using a separate account.

"I clicked Open GitHub and then closed the DirectAdmin tab." That page waits for the confirmation itself. Close it and the next time you will see the login was not completed, so you start over.

"It says the GitHub CLI is not installed." Then your site runs on a server where that component is not in place yet. Request it through Ask Invoker for help in the ⋯ menu of the assistant and we will set it up.

"My link stopped working." That happens if you revoked the access on GitHub or changed your password. You will see a message that the link no longer works; click Link again and walk through the same four steps.

MK
Maarten Keizer

Founder of Invoker. Over twenty years in hosting, system administration and web development; builds the Claude hosting himself and tests everything on our own servers first.

about maarten