mirror of
https://github.com/redhat-actions/push-to-registry.git
synced 2025-04-02 07:27:47 +02:00
Update README
Signed-off-by: divyansh42 <diagrawa@redhat.com>
This commit is contained in:
parent
9c4398c33e
commit
27553499f0
7 changed files with 28 additions and 14 deletions
6
.github/workflows/manifest-build-push.yaml
vendored
6
.github/workflows/manifest-build-push.yaml
vendored
|
@ -1,7 +1,7 @@
|
|||
# This workflow will perform a test whenever there
|
||||
# is some change in code done to ensure that the changes
|
||||
# are not buggy and we are getting the desired output.
|
||||
name: Push manifest to Quay.io
|
||||
name: Build and Push Manifest
|
||||
on:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
|
@ -16,7 +16,7 @@ env:
|
|||
|
||||
jobs:
|
||||
push-quay:
|
||||
name: Build and push image
|
||||
name: Build and push manifest
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
@ -51,7 +51,7 @@ jobs:
|
|||
|
||||
- name: Build Image
|
||||
id: build_image
|
||||
# for testing purpose only
|
||||
# for testing purpose only, to be changed after manifest feature merge in buildah build
|
||||
uses: divyansh42/buildah-build@manifest-support
|
||||
with:
|
||||
image: ${{ env.IMAGE_NAME }}
|
||||
|
|
13
README.md
13
README.md
|
@ -12,7 +12,7 @@
|
|||
[](./LICENSE)
|
||||
[](./dist)
|
||||
|
||||
Push-to-registry is a GitHub Action for pushing a container image to an image registry, such as Dockerhub, quay.io, the GitHub Container Registry, or an OpenShift integrated registry.
|
||||
Push-to-registry is a GitHub Action for pushing a container image or a manifest to an image registry, such as Dockerhub, quay.io, the GitHub Container Registry, or an OpenShift integrated registry.
|
||||
|
||||
This action only runs on Linux, as it uses [podman](https://github.com/containers/Podman) to perform the push. [GitHub's Ubuntu action runners](https://github.com/actions/virtual-environments#available-environments) come with Podman preinstalled. If you are not using those runners, you must first [install Podman](https://podman.io/getting-started/installation).
|
||||
|
||||
|
@ -24,8 +24,8 @@ Refer to the [`podman push`](http://docs.podman.io/en/latest/markdown/podman-man
|
|||
|
||||
| Input Name | Description | Default |
|
||||
| ---------- | ----------- | ------- |
|
||||
| image | Name of the image you want to push. Eg. `username/imagename` or `imagename`. Refer to [Image and Tag Inputs](https://github.com/redhat-actions/push-to-registry#image-tag-inputs). | **Required** - unless all tags include registry and image name
|
||||
| tags | The tag or tags of the image to push. For multiple tags, separate by whitespace. Refer to [Image and Tag Inputs](https://github.com/redhat-actions/push-to-registry#image-tag-inputs). | `latest`
|
||||
| image | Name of the image or manifest you want to push. Eg. `username/imagename` or `imagename`. Refer to [Image and Tag Inputs](https://github.com/redhat-actions/push-to-registry#image-tag-inputs). | **Required** - unless all tags include registry and image name
|
||||
| tags | The tag or tags of the image or manifest to push. For multiple tags, separate by whitespace. Refer to [Image and Tag Inputs](https://github.com/redhat-actions/push-to-registry#image-tag-inputs). | `latest`
|
||||
| registry | Hostname and optional namespace to push the image to. Eg. `quay.io` or `quay.io/username`. Refer to [Image and Tag Inputs](https://github.com/redhat-actions/push-to-registry#image-tag-inputs). | **Required** - unless all tags include registry and image name
|
||||
| username | Username with which to authenticate to the registry. Required unless already logged in to the registry. | None
|
||||
| password | Password, encrypted password, or access token to use to log in to the registry. Required unless already logged in to the registry. | None
|
||||
|
@ -83,6 +83,13 @@ For example:
|
|||
|
||||
`registry-path`: The first element of `registry-paths`, as a string.
|
||||
|
||||
## Pushing Manifest
|
||||
|
||||
This action supports manifest, this means you can push the manifest with this action.
|
||||
Input `image` and `tags` can be used for manifest also. Provided you can either push manifest or container image, not both of them together.
|
||||
|
||||
Refer to [Manifest Build and Push example](./github/workflows/manifest-build-push.yaml) for a sophisticated example of building and pushing a manifest.
|
||||
|
||||
## Examples
|
||||
|
||||
The example below shows how the `push-to-registry` action can be used to push an image created by the [**buildah-build**](https://github.com/redhat-actions/buildah-build) action.
|
||||
|
|
|
@ -6,10 +6,12 @@ branding:
|
|||
color: red
|
||||
inputs:
|
||||
image:
|
||||
description: 'Name of the image to push (e.g. username/imagename or imagename)'
|
||||
description: 'Name of the image/manifest to push (e.g. username/imagename or imagename)'
|
||||
required: false
|
||||
tags:
|
||||
description: 'The tag or tags of the image to push. For multiple tags, seperate by whitespace. For example, "latest v1"'
|
||||
description: |
|
||||
'The tag or tags of the image/manifest to push.
|
||||
For multiple tags, seperate by whitespace. For example, "latest v1"'
|
||||
required: false
|
||||
default: 'latest'
|
||||
registry:
|
||||
|
@ -39,7 +41,7 @@ inputs:
|
|||
|
||||
outputs:
|
||||
digest:
|
||||
description: 'The pushed image digest, as written to the "digestfile"'
|
||||
description: 'The pushed image/manifest digest, as written to the "digestfile"'
|
||||
registry-path:
|
||||
description: 'The first element of registry-paths.'
|
||||
registry-paths:
|
||||
|
|
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
@ -16,7 +16,7 @@ export enum Inputs {
|
|||
*/
|
||||
EXTRA_ARGS = "extra-args",
|
||||
/**
|
||||
* Name of the image to push (e.g. username/imagename or imagename)
|
||||
* Name of the image/manifest to push (e.g. username/imagename or imagename)
|
||||
* Required: false
|
||||
* Default: None.
|
||||
*/
|
||||
|
@ -34,7 +34,8 @@ export enum Inputs {
|
|||
*/
|
||||
REGISTRY = "registry",
|
||||
/**
|
||||
* The tag or tags of the image to push. For multiple tags, seperate by whitespace. For example, "latest v1"
|
||||
* 'The tag or tags of the image/manifest to push.
|
||||
* For multiple tags, seperate by whitespace. For example, "latest v1"'
|
||||
* Required: false
|
||||
* Default: "latest"
|
||||
*/
|
||||
|
@ -55,7 +56,7 @@ export enum Inputs {
|
|||
|
||||
export enum Outputs {
|
||||
/**
|
||||
* The pushed image digest, as written to the "digestfile"
|
||||
* The pushed image/manifest digest, as written to the "digestfile"
|
||||
* Required: false
|
||||
* Default: None.
|
||||
*/
|
||||
|
|
|
@ -236,6 +236,10 @@ async function run(): Promise<void> {
|
|||
isImageFromDocker ? getFullDockerImageName(sourceImages[i]) : sourceImages[i],
|
||||
destinationImages[i],
|
||||
]);
|
||||
// to push all the images referenced in the manifest
|
||||
if (isManifest) {
|
||||
args.push("--all");
|
||||
}
|
||||
if (podmanExtraArgs.length > 0) {
|
||||
args.push(...podmanExtraArgs);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue