Skip to content

Commit 697bcf5

Browse files
committed
Add support for multiple tags
1 parent eb479d8 commit 697bcf5

File tree

8 files changed

+194
-117
lines changed

8 files changed

+194
-117
lines changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ steps:
2525
name: Build & push Docker image
2626
with:
2727
image: repo/image
28-
tag: latest
28+
tags: v1, latest
2929
registry: registry-url.io
3030
dockerfile: Dockerfile.ci
3131
username: ${{ secrets.DOCKER_USERNAME }}
@@ -34,25 +34,25 @@ steps:
3434
3535
## Inputs
3636
37-
| Name | Description | Required |
38-
|------------|-----------------------------------------------------------------------------------------|----------|
39-
| image | Docker image name | Yes |
40-
| tag | Docker image tag (see [Tagging the image with GitOps](#tagging-the-image-using-gitops)) | No |
41-
| registry | Docker registry host | Yes |
42-
| dockerfile | Location of Dockerfile (defaults to `Dockerfile`) | No |
43-
| directory | Directory to pass to `docker build` command, if not project root | No |
44-
| buildArgs | Docker build arguments in format `KEY=VALUE,KEY=VALUE` | No |
45-
| username | Docker registry username | No |
46-
| password | Docker registry password or token | No |
47-
| githubOrg | GitHub organization to push image to (if not current) | No |
37+
| Name | Description | Required |
38+
|------------|----------------------------------------------------------------------------------------------------------|----------|
39+
| image | Docker image name | Yes |
40+
| tags | Comma separated docker image tags (see [Tagging the image with GitOps](#tagging-the-image-using-gitops)) | No |
41+
| registry | Docker registry host | Yes |
42+
| dockerfile | Location of Dockerfile (defaults to `Dockerfile`) | No |
43+
| directory | Directory to pass to `docker build` command, if not project root | No |
44+
| buildArgs | Docker build arguments in format `KEY=VALUE,KEY=VALUE` | No |
45+
| username | Docker registry username | No |
46+
| password | Docker registry password or token | No |
47+
| githubOrg | GitHub organization to push image to (if not current) | No |
4848

4949
## Outputs
5050

5151
| Name | Description | Format |
5252
|---------------|-------------------------------------------------------------------|----------------------------|
53-
| imageFullName | Full name of the Docker image with registry prefix and tag suffix | `registry/owner/image:tag` |
53+
| imageFullName | Full name of the Docker image with registry prefix | `registry/owner/image` |
5454
| imageName | Name of the Docker image with owner prefix | `owner/image` |
55-
| tag | Tag for the Docker image | `tag` |
55+
| tags | Tags for the Docker image | `v1,latest` |
5656

5757
## Examples
5858

@@ -124,7 +124,7 @@ with:
124124

125125
## Tagging the image using GitOps
126126

127-
By default, if you do not pass a `tag` input this action will use an algorithm based on the state of your git repo to determine the Docker image tag. This is designed to enable developers to more easily use [GitOps](https://www.weave.works/technologies/gitops/) in their CI/CD pipelines. Below is a table detailing how the GitHub trigger (branch or tag) determines the Docker tag.
127+
By default, if you do not pass a `tags` input this action will use an algorithm based on the state of your git repo to determine the Docker image tag. This is designed to enable developers to more easily use [GitOps](https://www.weave.works/technologies/gitops/) in their CI/CD pipelines. Below is a table detailing how the GitHub trigger (branch or tag) determines the Docker tag.
128128

129129
| Trigger | Commit SHA | Docker Tag |
130130
|--------------------------|------------|----------------------|

action.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: 'Docker Build & Push'
2-
description: 'Builds a Docker image and pushes to a private registry'
1+
name: 'Docker Build, Tag & Push'
2+
description: 'Builds a Docker image and pushes to a private registry with support for multiple tags'
33
author: 'Sean Smith'
44
inputs:
55
image:
66
description: 'Name of the Docker image'
77
required: true
8-
tag:
9-
description: 'Tag override for Docker image'
8+
tags:
9+
description: 'Tags override for Docker image'
1010
required: false
1111
registry:
1212
description: 'Target Docker registry'
@@ -35,8 +35,8 @@ outputs:
3535
description: 'Full name of the Docker image with registry prefix and tag suffix'
3636
imageName:
3737
description: 'Name of the Docker image with owner prefix'
38-
tag:
39-
description: 'Tag for the Docker image'
38+
tags:
39+
description: 'Tags for the Docker image'
4040
runs:
4141
using: 'node12'
4242
main: 'dist/index.js'

0 commit comments

Comments
 (0)