initial commit
build-and-push / build (aarch64, linux/arm64) (push) Has been cancelled
build-and-push / build (amd64, linux/amd64) (push) Has been cancelled
build-and-push / build (armhf, linux/arm/v6) (push) Has been cancelled
build-and-push / build (armv7, linux/arm/v7) (push) Has been cancelled
build-and-push / build (i386, linux/386) (push) Has been cancelled
build-and-push / build (aarch64, linux/arm64) (push) Has been cancelled
build-and-push / build (amd64, linux/amd64) (push) Has been cancelled
build-and-push / build (armhf, linux/arm/v6) (push) Has been cancelled
build-and-push / build (armv7, linux/arm/v7) (push) Has been cancelled
build-and-push / build (i386, linux/386) (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
# Publishing pre-built images (Gitea)
|
||||
|
||||
Without this, Supervisor builds the image locally on every install/update
|
||||
using `Dockerfile` + `build.yaml` — which works, but is slow on
|
||||
resource-constrained hosts (a Pi building a 20-minute cross-compiled
|
||||
image) and means every user separately downloads all the build layers
|
||||
instead of one shared pre-built image.
|
||||
|
||||
## One-time setup
|
||||
|
||||
1. **Push this whole thing to a Gitea repo.** Repo root should contain
|
||||
`repository.yaml`, `.gitea/workflows/build-and-push.yml`, and the
|
||||
`mqtt-cert-manager/` folder — not the add-on files directly at repo
|
||||
root. This matches how Supervisor expects an add-on repository to be
|
||||
laid out (one subfolder per add-on).
|
||||
|
||||
2. **Create a Personal Access Token**: your Gitea avatar (top right) >
|
||||
Settings > Applications > "Generate New Token" > scope at least
|
||||
`write:package` (and `read:package`). Don't use the auto-injected
|
||||
Actions token here — it's known not to authenticate correctly against
|
||||
Gitea's own container registry.
|
||||
|
||||
3. **Add it as a repo secret**: repo Settings > Actions > Secrets > New
|
||||
secret, name it `REGISTRY_TOKEN`, paste the PAT.
|
||||
|
||||
4. **Edit the placeholders** — search-and-replace `git.example.com` and
|
||||
`YOUR_USER` for real values in:
|
||||
- `mqtt-cert-manager/config.yaml` (`image:` and `url:`)
|
||||
- `repository.yaml`
|
||||
- `.gitea/workflows/build-and-push.yml` (`REGISTRY_HOST`, `REGISTRY_OWNER`)
|
||||
|
||||
5. **Push to `main`.** The workflow builds all 5 architectures (using
|
||||
QEMU emulation for anything that isn't amd64) and pushes each as
|
||||
`<registry>/<owner>/mqtt-cert-manager-<arch>:<version>` plus a
|
||||
`:latest` tag.
|
||||
|
||||
## Every future release
|
||||
|
||||
Bump `version:` in `mqtt-cert-manager/config.yaml` before pushing.
|
||||
Supervisor pulls the image tag matching that exact version string — if
|
||||
you forget to bump it, your push still builds and publishes fine, it
|
||||
just overwrites the same version tag and Supervisor won't see anything
|
||||
new to update to.
|
||||
|
||||
## Adding it to Home Assistant
|
||||
|
||||
Settings > Add-ons > Add-on store > ⋮ (top right) > Repositories > paste
|
||||
your Gitea repo's clone URL. The add-on should appear in the store,
|
||||
pulling the pre-built image instead of building locally.
|
||||
|
||||
## If you'd rather test locally first
|
||||
|
||||
Remove the `image:` line from `config.yaml` temporarily — Supervisor
|
||||
falls back to building from `Dockerfile` locally, which is a faster
|
||||
iteration loop while you're still making changes, before you wire up CI.
|
||||
Reference in New Issue
Block a user