Skip to main content
Theme

Connectors

GitHub

The tool reads a static website whose code is in a GitHub repository, and copies it to an Insites v6 instance. That covers plain HTML, CSS and JavaScript, a GitHub Pages site, and the built output of Jekyll, Hugo, Eleventy, Astro or a Next.js static export. It only reads: it sends GitHub nothing but GET requests, and, for a private repository, with a token that can only read that one repository. A public repository needs no token.

How it reads the site

The tool copies the built site: the finished HTML a visitor gets, not the generator's templates. It looks for it in this order, and reads everything at one commit, so a push during the read never mixes two versions:

  1. The branch and folder GitHub Pages publishes from, when GitHub shows the Pages settings.
  2. A gh-pages branch.
  3. A committed build folder on the default branch (a built site's _astro and _next folders are copied; only the source folders of Jekyll and Hugo, _layouts, _includes, _posts, _data and _sass, are skipped): _site (Jekyll, Eleventy), public (Hugo), dist (Astro), out (Next.js), build or docs.
  4. Plain HTML at the root of the default branch, or in docs.

If the repository holds only a generator's source, for example a site GitHub Actions builds and publishes without committing the result, the tool stops and says so. Publish the built site to a gh-pages branch, or commit the build folder, then connect again.

Pages, styles, scripts, SVG and JSON are read from the repository, so a private repository works with a token. Images, fonts and other binary files are copied from the published site, where the same files are served.

What you need

  1. The published site's address, as visitors open it now: its own domain, or its github.io, Netlify or Vercel address.
  2. The repository's address, such as https://github.com/your-org/your-site.
  3. For a private repository only: a fine-grained personal access token for that repository. Leave the token field empty for a public repository. On GitHub, open Settings, Developer settings, Personal access tokens, Fine-grained tokens, then Generate new token:
    • Resource owner: the account or organization that owns the repository.
    • Expiration: 7 days is enough for most moves.
    • Repository access: Only select repositories, and pick the site's repository.
    • Repository permissions: Contents: Read-only. Metadata: Read-only is set for you. Every other permission stays at No access.

A public repository, without a token

With no token, the tool reads a public repository the way anyone can. GitHub allows 60 requests an hour from one network without a token, so the tool reads in bulk: the whole file list in one request per branch, and each file's text from raw.githubusercontent.com, which does not count against that limit. A whole site takes about six requests. If the limit is reached anyway, for example because other tools on the same network used it, the tool says so and asks for a token. If the repository is private, the Source step says This repository is private; add a read-only token.

If the organization requires approval for fine-grained tokens, an owner approves it under the organization's Settings, Personal access tokens, Pending requests. The token is kept encrypted for as long as the migration needs it, and removed when you close the migration: how long a key is kept. Delete it on GitHub afterwards.

What is copied

In the repositoryOn Insites
HTML pagesEach page at its own address (about/index.html becomes /about), with its title and description. Each page brings its own head to one shared layout, site, and its body is the page.
Links and files named in a pageRelative paths, root paths (including a project site's /repository-name prefix) and links to the site's own address are pointed at the copied page or file. Links to other sites stay as they are.
Styles, scripts, images, fonts and documentsEvery file in the site's folder, kept at the same path under the new site's files. A stylesheet's root paths are made relative, so it finds its images.
Formspree and Netlify formsEach is rebuilt in the Insites form builder, where it was, with its fields, saving to its own table. The services' own fields (form-name, the honeypot, _gotcha) are left off. Past submissions come from the CSV export each service gives, added on the Forms step.
RedirectsFrom _redirects, netlify.toml and vercel.json, and the redirect pages Jekyll's redirect_from and Hugo's aliases write. Each goes into Settings, Redirects.
robots.txtCopied, pointing at the instance's own /sitemap.xml.

What does not move

  • The build. GitHub Actions workflows, the generator's templates, Markdown and settings stay in the repository. The new site is edited on Insites. The To do list counts the workflows, and asks you to turn off the one that publishes the old site.
  • Serverless functions. Netlify and Vercel functions run code on the host, which a copied static site cannot run. Each is listed to rebuild.
  • Secrets. GitHub and the hosts never show a secret's value, so none is read. A key the site needs is added again in Insites Console.
  • Redirect patterns. A rule with a wildcard, a placeholder, a condition or a 200 rewrite is not copied, because Settings, Redirects takes one address to another. The run's log names each.
  • Forms posting elsewhere. A form posting to a service other than Formspree or Netlify is left as it is, and keeps posting there.

The repository itself is never changed, and stays your code's history.