CI/CD
CI/CD is one of two ways to populate your Stagenet’s Imported Contracts. Connect a GitHub repository, and the Stagenet compiles it on every push — keeping the import registry in sync without anyone running a command.
The other way is the CLI, where you run npx contract.dev push-contracts from your terminal. Both paths produce the same Imported Contracts; CI/CD just removes the manual step.
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.
- You want a per-commit compilation history (which commit produced which Imported Contract version).
Use the CLI instead when you want on-demand pushes from your terminal, don’t want to install a GitHub App, or work in a repo the Stagenet can’t reach (private monorepo on a self-hosted git server, local-only experiments).
What CI/CD adds
Beyond what the CLI already does, CI/CD adds:
- Automatic compilation on push — no
forge build/hardhat compile+push-contractsstep in your workflow; the Stagenet runs them on every commit. - Multiple repos per Stagenet — connect several repositories (useful for protocols split across core/periphery, or for recognising third-party contracts). See Working with monorepos.
- Compilation history — every build is recorded with stdout, stderr, and the artifacts it produced. See Compilations.
CI/CD does not deploy contracts for you, replace your existing deployment scripts, or run your test suite unless you add it to your compile command.
Get started
Reference
- Build Configuration — framework, project root, install/compile commands, env vars, artifact include/exclude.
- Compilations — what triggers them, reading status, debugging failures.
- Working with monorepos — multiple repos per project, project root patterns.