diff --git a/AGENTS.md b/AGENTS.md index 934592f..06a09ae 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -11,9 +11,10 @@ This repo provides reusable Gitea composite actions for homelab CI/CD pipelines. Logs into the container registry, sets up SSH key for `docker-build.haven`, creates a remote Buildx context over SSH, and builds + pushes a multi-arch Docker image. **Inputs:** -- `image` (required) — full image ref without tag (`:latest` appended) +- `image` (required) — full image ref without tag - `registry_password` (required) — registry password/token (use secrets) - `ssh_key` (required) — SSH private key for remote builder (use secrets) +- `image_tag` (default `latest`) — tag to apply to the built image - `registry_host` (default `git.ivanch.me`) — container registry hostname - `registry_username` (default `ivanch`) — registry username - `platforms` (default `linux/amd64,linux/arm64`) — target build platforms diff --git a/README.md b/README.md index 28965a2..287ec27 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ Reusable composite actions for Gitea Actions CI/CD pipelines in the homelab. -> **Note:** Gitea cannot resolve actions the GitHub way (`ivanch/pipeline-actions/...`). Every `uses:` reference below must use the full URL form `https://git.ivanch.me/ivanch/pipeline-actions/@main`. - ## Actions ### `build-and-push` @@ -22,6 +20,7 @@ jobs: registry_password: ${{ secrets.REGISTRY_PASSWORD }} ssh_key: ${{ secrets.SSH_KEY_DOCKERBUILD }} # optional — these have sensible defaults: + # image_tag: latest # registry_host: git.ivanch.me # registry_username: ivanch # platforms: linux/amd64,linux/arm64 @@ -33,9 +32,10 @@ jobs: | Input | Required | Default | Description | |---|---|---|---| -| `image` | ✅ | — | Full image reference without tag (`:latest` is appended) | +| `image` | ✅ | — | Full image reference without tag | | `registry_password` | ✅ | — | Registry password/token (use secrets) | | `ssh_key` | ✅ | — | SSH private key for the remote builder (use secrets) | +| `image_tag` | ❌ | `latest` | Tag to apply to the built image | | `registry_host` | ❌ | `git.ivanch.me` | Container registry hostname | | `registry_username` | ❌ | `ivanch` | Registry username | | `platforms` | ❌ | `linux/amd64,linux/arm64` | Target build platforms | diff --git a/build-and-push/action.yaml b/build-and-push/action.yaml index a1fa8c8..be1169c 100644 --- a/build-and-push/action.yaml +++ b/build-and-push/action.yaml @@ -14,8 +14,12 @@ inputs: description: Password / token for the container registry (pass via secrets) required: true image: - description: Full image reference (host/path/name) without tag — :latest is appended + description: Full image reference (host/path/name) without tag required: true + image_tag: + description: Tag to apply to the built image + required: false + default: latest platforms: description: Comma-separated list of target platforms required: false @@ -86,4 +90,4 @@ runs: builder: remote-builder platforms: ${{ inputs.platforms }} tags: | - ${{ inputs.image }}:latest + ${{ inputs.image }}:${{ inputs.image_tag }}