setup workflow
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
# workflows
|
||||
|
||||
Reusable Gitea Actions workflows for the apps in the cluster.
|
||||
|
||||
## `docker-image.yaml`
|
||||
|
||||
Builds and pushes one or more images with a uniform tag set from
|
||||
[docker/metadata-action](https://github.com/docker/metadata-action):
|
||||
|
||||
| Tag | When |
|
||||
|---|---|
|
||||
| `<UTC yyyymmddHHMMSS>-<sha7>` | every build; Flux `ImagePolicy` sorts on the timestamp |
|
||||
| `1.2.3`, `1.2`, `1` | on a `v1.2.3` git tag (`1` is skipped while the major is `0`; pre-releases only get the full version) |
|
||||
| `latest` | on the default branch |
|
||||
|
||||
The tag set is computed once per run, so every image of a multi-image repo gets the same tags.
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
test: ...
|
||||
image:
|
||||
needs: test
|
||||
uses: traberph/workflows/.gitea/workflows/docker-image.yaml@main
|
||||
with:
|
||||
images: '[{"image": "registry.traberph.de/private/cv"}]'
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
secrets:
|
||||
registry-username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
registry-token: ${{ secrets.REGISTRY_TOKEN }}
|
||||
```
|
||||
|
||||
Inputs:
|
||||
|
||||
- `images` (required): JSON array of `{"image", "context", "dockerfile"}`; `context` defaults to `.`, `dockerfile` to `<context>/Dockerfile`.
|
||||
- `registry`: registry to log in to (default `registry.traberph.de`).
|
||||
- `platforms`: default `linux/amd64`. QEMU is set up when an `arm` platform is listed.
|
||||
- `build-args`: newline-separated `KEY=value`, passed to every image.
|
||||
- `push`: default `true`.
|
||||
- `cache`: keep the layer cache in the registry as `<image>:buildcache` (default `false`).
|
||||
|
||||
Outputs: `tag` (the timestamp tag), `version`, `tag-names`.
|
||||
|
||||
## Updates
|
||||
|
||||
Renovate (running in the cluster, see `cumulus/apps/base/renovate`) opens PRs for the actions used here; see [`renovate.json`](renovate.json).
|
||||
Reference in New Issue
Block a user