Skip to main content

Source in git

Each Site has its own repository on Fluid’s GitHub, named site-<id>. A new Site’s repository starts from the main branch of the public member-site-template. The repository is the record of what you published and a way to get a Site’s code onto another machine. fluid sites publish and fluid deploy save the source before they upload the build:
  1. The CLI asks Fluid for a short-lived credential for the Site’s repository.
  2. It commits the folder and pushes it to the repository’s main branch. A publish to a branch pushes to a git branch named after the branch’s slug.
  3. Then it uploads and publishes the build. A push that fails publishes nothing.
The commit leaves out .env, .env.* (such as .env.local), .envrc, .npmrc, .member-site.json, node_modules and the build folder. Everything else in the folder is committed. A file such as secrets.json or .env-secret isn’t left out, so keep secrets out of the folder. The source isn’t saved when:
  • you pass --no-source;
  • Fluid can’t set up the Site’s repository. The command says so and publishes without the source, and a later publish saves it;
  • the server doesn’t offer source saving. The command says so and publishes without it.
So the repository usually holds every publish, but not always. To undo a publish, roll back to an earlier deployment instead of pushing an old commit.

Pull a Site’s source

fluid sites pull clones a Site’s source into a new folder and binds the folder to the Site, so fluid sites publish runs there:
The first argument is the Site’s handle or id. The folder defaults to the handle, and must be new or empty. --branch <slug> clones the Site’s branch instead. A Site whose source was never saved has nothing to clone.

Branches

A branch is a private copy of a Site, with its own address, to publish to and check before the Site itself changes. A Site has at most one branch. Only the Site’s owner and company admins open it, and search engines never index it.
  • fluid sites publish --branch <slug> publishes the folder to the branch. The Site itself doesn’t change.
  • fluid sites branch delete deletes the branch and its own Site. It asks first, and --yes skips the question. The Site itself doesn’t change.
  • A branch of a Site with a database gets its own copy of the database. See Branches on the database page.
With the API, see Branch a site, or for a company Site Branch a company site.