Build and publish Docker images to Docker Hub with a safe, opinionated tagging strategy, multi-platform support, and zero boilerplate.
This action is designed to prevent common release mistakes such as accidentally pushing
latestfor prereleases.
𧬠Multi-platform images
linux/amd64linux/arm64v prefix (v1.2.3 β 1.2.3)[!IMPORTANT]
CI/CD Runner Requirement
Recommended Runner:
ubuntu-latestThis action must be executed on a Linux GitHub Actions runner.
runs-on: ubuntu-latestWhy Linux runners?
- Docker image builds require Linux kernel features.
- GitHub-hosted macOS and Windows runners do not provide Docker Desktop.
- Docker Desktop (used locally on macOS/Windows) cannot run inside CI runners.
- Linux runners provide a native Docker daemon required by Buildx.
What this means
- Builds run on Linux CI runners.
- Built images run on Linux, macOS, and Windows via Docker Desktop or WSL2.
- macOS / Windows runners are not supported for building.
This is the standard and recommended setup for Docker-based CI/CD workflows.
- uses: teneplaysofficial/docker-publish@v1
with:
image_repo: tenedev/release-hub
version: v1.2.4
docker_username: $
docker_password: $
The action determines tags only from the version string. All tags are derived strictly and exclusively from the provided version. No tags are inferred from Git history, branches, or commit metadata.
-)Example
1.2.3
v1.2.4
Tags pushed
:1.2.4
:latest
:1
nextExample
1.2.3-1
1.2.3-34
Tags pushed
:1.2.3-34
:next
Example
1.2.3-beta.2
1.2.3-alpha
1.2.3-rc.1
Tags pushed
:1.2.3-beta.2
:beta
:1.2.3-alpha
:alpha
:1.2.3-rc.1
:rc
latest is pushed only for stable releases:1) are only for stable releasesThese rules are enforced automatically and cannot be disabled.
By default, images are built for:
linux/amd64
linux/arm64
These images run on:
When dry_run: true:
Ideal for CI validation and release previews.
This action uses GitHub Actions cache for Docker layers.
Benefits
No configuration required.
| Name | Required | Default | Description |
|---|---|---|---|
image_repo |
β | β | Docker image repo (username/repo) |
version |
β | β | App version (1.2.3, v1.2.3-beta.2) |
docker_username |
β | β | Docker Hub username |
docker_password |
β | β | Docker Hub token/password |
context_path |
β | . |
Docker build context |
dockerfile_path |
β | ./Dockerfile |
Path to Dockerfile |
dry_run |
β | false |
Build only, do not push images |
summary |
β | true |
Generate job summary |
The workflow intentionally fails if:
image_repo is not in namespace/repo format.latest.This prevents broken or unsafe releases.
name: Docker Release
on:
push:
tags:
- "v*"
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: teneplaysofficial/docker-publish@v1
with:
image_repo: tenedev/release-hub
version: $
docker_username: $
docker_password: $
The action automatically strips the leading
vfrom Git tags.
When summary: true, the action publishes a job summary including:
This improves traceability and auditability.
Below is an example of what appears in the GitHub Actions β Job Summary panel:
## Docker Publish Summary
Image: `tenedev/release-hub`
Version: `1.2.4`
Strategy: `stable`
Mode: publish
### Tags
- `tenedev/release-hub:1.2.4`
- `tenedev/release-hub:latest`
- `tenedev/release-hub:1`
### Platforms
- linux/amd64
- linux/arm64
Prerelease (Dry-Run) Example
## Docker Publish Summary
Image: `tenedev/release-hub`
Version: `1.3.0-rc.1`
Strategy: `labeled`
Mode: dry-run
### Tags
- `tenedev/release-hub:1.3.0-rc.1`
- `tenedev/release-hub:rc`
### Platforms
- linux/amd64
- linux/arm64
Most Docker workflows:
latest accidentally.This action:
Issues and PRs are welcome. This action is intentionally small, focused, and predictable.