docs: add job name: to all usage snippets + rule requiring named jobs
This commit is contained in:
@@ -124,6 +124,7 @@ Consumer projects must set these secrets in Gitea repo settings (Settings → Ac
|
|||||||
## Rules
|
## Rules
|
||||||
|
|
||||||
- Pin composite action refs to `@main` until version tags are created.
|
- Pin composite action refs to `@main` until version tags are created.
|
||||||
|
- Every job **must** have a `name:` field (e.g. `name: Build Image`, `name: Deploy (internal)`). Unnamed jobs render as their raw ID (`build`, `deploy`, …) in the Gitea Actions UI and run logs. The workflow template above includes `name:` on every job — copy it as-is.
|
||||||
- Always use the full URL `https://git.ivanch.me/ivanch/pipeline-actions/<action>@main` for `uses:` — Gitea cannot resolve the bare GitHub-style `ivanch/pipeline-actions/...` path.
|
- Always use the full URL `https://git.ivanch.me/ivanch/pipeline-actions/<action>@main` for `uses:` — Gitea cannot resolve the bare GitHub-style `ivanch/pipeline-actions/...` path.
|
||||||
- Always use `runs-on: ubuntu-amd64` (homelab Gitea runner label).
|
- Always use `runs-on: ubuntu-amd64` (homelab Gitea runner label).
|
||||||
- Always build `linux/amd64,linux/arm64` — the cluster has mixed arch (iris+vega=amd64, nebula+nexus=arm64).
|
- Always build `linux/amd64,linux/arm64` — the cluster has mixed arch (iris+vega=amd64, nebula+nexus=arm64).
|
||||||
|
|||||||
46
README.md
46
README.md
@@ -11,6 +11,7 @@ Builds and pushes a multi-architecture Docker image using a remote Buildx builde
|
|||||||
```yaml
|
```yaml
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
name: Build Image
|
||||||
runs-on: ubuntu-amd64
|
runs-on: ubuntu-amd64
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -35,13 +36,6 @@ jobs:
|
|||||||
| `image` | ✅ | — | Full image reference without tag |
|
| `image` | ✅ | — | Full image reference without tag |
|
||||||
| `registry_password` | ✅ | — | Registry password/token (use secrets) |
|
| `registry_password` | ✅ | — | Registry password/token (use secrets) |
|
||||||
| `ssh_key` | ✅ | — | SSH private key for the remote builder (use secrets) |
|
| `ssh_key` | ✅ | — | SSH private key for the remote builder (use secrets) |
|
||||||
| `image_tag` | ❌ | `latest` | Comma-separated tag(s) to apply to the built image (e.g. `latest,abc1234`). Pushing a commit-pinned tag alongside `:latest` is how Docker-only deploys consume per-commit tags. |
|
|
||||||
| `registry_host` | ❌ | `git.ivanch.me` | Container registry hostname |
|
|
||||||
| `registry_username` | ❌ | `ivanch` | Registry username |
|
|
||||||
| `platforms` | ❌ | `linux/amd64,linux/arm64` | Target build platforms |
|
|
||||||
| `build_context` | ❌ | `.` | Docker build context |
|
|
||||||
| `build_dockerfile` | ❌ | `Dockerfile` | Dockerfile path |
|
|
||||||
| `build_args` | ❌ | _(empty)_ | Build arguments, one `KEY=VALUE` per line; each becomes a `--build-arg` |
|
|
||||||
| `docker_host` | ❌ | `docker-build.haven` | Remote builder hostname |
|
| `docker_host` | ❌ | `docker-build.haven` | Remote builder hostname |
|
||||||
| `docker_user` | ❌ | `root` | SSH user for remote builder |
|
| `docker_user` | ❌ | `root` | SSH user for remote builder |
|
||||||
|
|
||||||
@@ -51,21 +45,6 @@ jobs:
|
|||||||
|
|
||||||
Validates a kubeconfig, installs kubectl, and performs a `rollout restart` of a Kubernetes Deployment.
|
Validates a kubeconfig, installs kubectl, and performs a `rollout restart` of a Kubernetes Deployment.
|
||||||
|
|
||||||
```yaml
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: ubuntu-amd64
|
|
||||||
needs: build
|
|
||||||
steps:
|
|
||||||
- uses: https://git.ivanch.me/ivanch/pipeline-actions/deploy-restart@main
|
|
||||||
with:
|
|
||||||
kube_config: ${{ secrets.KUBE_CONFIG }}
|
|
||||||
deployment_name: my-app
|
|
||||||
# optional:
|
|
||||||
# namespace: default
|
|
||||||
# kube_version: stable
|
|
||||||
```
|
|
||||||
|
|
||||||
| Input | Required | Default | Description |
|
| Input | Required | Default | Description |
|
||||||
|---|---|---|---|
|
|---|---|---|---|
|
||||||
| `kube_config` | ✅ | — | Full kubeconfig YAML (use secrets) |
|
| `kube_config` | ✅ | — | Full kubeconfig YAML (use secrets) |
|
||||||
@@ -80,6 +59,7 @@ Validates a kubeconfig, installs kubectl, and applies Kubernetes manifest(s) tha
|
|||||||
```yaml
|
```yaml
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
|
name: Apply Manifests (internal)
|
||||||
runs-on: ubuntu-amd64
|
runs-on: ubuntu-amd64
|
||||||
needs: build
|
needs: build
|
||||||
steps:
|
steps:
|
||||||
@@ -103,6 +83,22 @@ jobs:
|
|||||||
|
|
||||||
> At least one of `manifest` or `manifests` must be set; a missing file fails the step (the manifest must live in the repo).
|
> At least one of `manifest` or `manifests` must be set; a missing file fails the step (the manifest must live in the repo).
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
jobs:
|
||||||
|
restart:
|
||||||
|
name: Rollout Restart (internal)
|
||||||
|
runs-on: ubuntu-amd64
|
||||||
|
needs: apply
|
||||||
|
steps:
|
||||||
|
- uses: https://git.ivanch.me/ivanch/pipeline-actions/deploy-restart@main
|
||||||
|
with:
|
||||||
|
kube_config: ${{ secrets.KUBE_CONFIG }}
|
||||||
|
deployment_name: my-app
|
||||||
|
# optional:
|
||||||
|
# namespace: default
|
||||||
|
# kube_version: stable
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### `ssh-deploy`
|
### `ssh-deploy`
|
||||||
@@ -112,6 +108,7 @@ SSH into a remote host and run `docker compose pull` + `docker compose up -d --f
|
|||||||
```yaml
|
```yaml
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
|
name: SSH Deploy (internal)
|
||||||
runs-on: ubuntu-amd64
|
runs-on: ubuntu-amd64
|
||||||
needs: build
|
needs: build
|
||||||
steps:
|
steps:
|
||||||
@@ -141,7 +138,10 @@ jobs:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Required Secrets
|
## Rules
|
||||||
|
|
||||||
|
- Every job **must** have a `name:` field (e.g. `name: Build Image`, `name: Deploy (internal)`). Named jobs make the Gitea Actions UI and run logs readable — unnamed jobs show up as the raw job ID (`build`, `deploy`, …). The templates above all include `name:`.
|
||||||
|
- Pin composite action refs to `@main` until version tags are created.
|
||||||
|
|
||||||
Consumer repositories need these secrets configured in Gitea:
|
Consumer repositories need these secrets configured in Gitea:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user