This actions is intended for publishing docker images either to a public registry, or private.
This action requires special permission at workflow level
permissions:
content: read
packages: write
permisions:
content: read
id-token: write
input | required | default value | description |
---|---|---|---|
image-name |
true |
"" |
The image name, in case of ECR it's the repository name |
context |
false |
. |
The context path for the docker build |
docker-file |
false |
./Dockerfile |
The path to the Dockerfile to build |
github-token |
false |
"" |
Required only when registry is github |
registry |
false |
github |
The registry location. Either github or ecr |
prefix |
false |
"" |
Prefix to be appended to the image tag, for example branch- will result on <image-name>:branch-master |
tags |
false |
"" | tags strategy configuration. For more information see: https://github.com/docker/metadata-action?tab=readme-ov-file#tags-input |
build-args |
false |
List of build-time variables |
- name: Build and publish
uses: littlehorse-enterprises/publish-image@v1
with:
image-name: <image-name>
dockerfile: path/to/Dockerfile
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish
uses: ittlehorse-enterprises/publish-image@v1
with:
image-name: <image-name>
dockerfile: path/to/Dockerfile
registry: ecr
- name: Build and publish
uses: ittlehorse-enterprises/publish-image@v1
with:
image-name: <image-name>
dockerfile: path/to/Dockerfile
prefix: brach-
- name: Build and publish
uses: ittlehorse-enterprises/publish-image@v1
with:
image-name: <image-name>
dockerfile: path/to/Dockerfile
build-args: |
VERSION=0.0.0