Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/publish-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ on:
required: false
default: "linux/amd64,linux/arm64"
type: string
build-args:
description: "Build-time variables, newline-separated KEY=VALUE pairs (e.g. VERSION=1.2.3)"
required: false
default: ""
type: string

env:
image-name: ${{ inputs.image-name }}
Expand All @@ -47,6 +52,7 @@ env:
context: ${{ inputs.context }}
dockerfile: ${{ inputs.dockerfile }}
platforms: ${{ inputs.platforms }}
build-args: ${{ inputs.build-args }}

jobs:
publish-container:
Expand Down Expand Up @@ -105,6 +111,7 @@ jobs:
file: ${{ env.dockerfile }}
push: true
platforms: ${{ env.platforms }}
build-args: ${{ env.build-args }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
5 changes: 5 additions & 0 deletions docs/workflows/publish-container.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This is intended for releasing dev/edge images, not stable semver releases.
| `context` | No | `'.'` | Docker build context. |
| `dockerfile` | No | `'Dockerfile'` | Path to `Dockerfile` relative to repo root/context. |
| `platforms` | No | `'linux/amd64,linux/arm64'` | Target platforms for the image. |
| `build-args` | No | `''` | Build-time variables, newline-separated `KEY=VALUE` pairs, passed through to `docker/build-push-action` (e.g. `VERSION=1.2.3`). |

## Secrets

Expand Down Expand Up @@ -47,9 +48,13 @@ jobs:
context: .
dockerfile: Dockerfile
platforms: linux/amd64,linux/arm64
build-args: |
VERSION=1.2.3
secrets: inherit
```

`build-args` is optional — omit it if your Dockerfile doesn't declare any `ARG`s you need to pass through.

This will publish images like:

- `ghcr.io/<owner>/my-service:<sha>`
Expand Down