Skip to Content

CI/CD

You can import contracts automatically from GitHub onto your Stagenet via CI/CD.

When you connect a repository, contract.dev compiles it and imports the compiled contracts onto your Stagenet. After that, every push creates a new compilation, keeping your imported contracts up to date as your code changes.

This CI/CD flow is one way to import contracts. You can also import contracts manually from a local Hardhat or Foundry project using the CLI.

How it works

The CI/CD flow is:

  1. Connect a GitHub repository to your Stagenet.
  2. Configure how contract.dev should install dependencies and compile the project.
  3. contract.dev runs a compilation against its latest commit.
  4. Compiled contract artifacts are imported into your Stagenet.
  5. Future pushes create new compilations and update your imported contracts.

Each connected repository has its own build configuration and compilation history. A Stagenet can also have multiple connected repositories.

When to use CI/CD

CI/CD is the right choice when:

  • Contracts in your repo change regularly and you want imports to stay in sync without thinking about it.
  • A team works on the project — every push from anyone gets picked up, with no per-developer setup.

In this section

  • Compilations — understand compilation triggers and behaviour.
  • Build Configuration — configure how contract.dev installs dependencies and compiles your repository.
Last updated on