# `NBPR.Artifact.Registry`
[🔗](https://github.com/jimsynz/nbpr/blob/v0.7.0/lib/nbpr/artifact/registry.ex#L1)

Project registry used as a shared cache for source-built packages.

Configure the registry in the consuming project's `config/config.exs`.
It is searched before each package's declared sites. Publishing is opt-in:

    config :nbpr,
      registry: "forgejo.example.com/my-org/firmware",
      publish_after_build: true

With publishing disabled (the default), the registry is a read-only cache.
Set `NBPR_REGISTRY_USERNAME` and `NBPR_REGISTRY_TOKEN` for private Forgejo
pulls and pushes. Credentials are sent only to the configured registry.
HTTPS is the default; an explicit `http://` prefix is supported for local
development. Basic and same-origin Bearer authentication are supported.

A `ghcr.io/` prefix uses the existing GHCR backend and its `GHCR_TOKEN` /
`GITHUB_TOKEN` credentials instead.

# `publish_after_build!`

Publishes a newly built tarball when the project opts into cache writes.

# `sites`

Returns project registry sites followed by the package's declared sites.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
