GitHub Action to push a container image to an image registry.
Find a file
Tim Etchells 7c3d1059c8 Copy exec from oc-login for better error reporting
Signed-off-by: Tim Etchells <tetchell@redhat.com>
2020-11-26 14:02:33 -05:00
.github/workflows Add verify bundle action and make inputs 'required' 2020-11-17 14:19:07 -05:00
dist Copy exec from oc-login for better error reporting 2020-11-26 14:02:33 -05:00
src Copy exec from oc-login for better error reporting 2020-11-26 14:02:33 -05:00
.gitignore first implementation push to quay action 2020-11-07 13:04:04 +01:00
action.yml Add image-url to the output of the action. 2020-11-23 18:11:37 -05:00
LICENSE first implementation push to quay action 2020-11-07 13:04:04 +01:00
package-lock.json Add verify bundle action and make inputs 'required' 2020-11-17 14:19:07 -05:00
package.json Add verify bundle action and make inputs 'required' 2020-11-17 14:19:07 -05:00
README.md Add image-url to the output of the action. 2020-11-23 18:11:37 -05:00
tsconfig.json first implementation push to quay action 2020-11-07 13:04:04 +01:00

push-to-registry

Verify Bundle tag badge license badge size badge

Push-to-registry is a GitHub Action for pushing an OCI-compatible image to an image registry, such as Dockerhub, Quay.io, or an OpenShift integrated registry.

This action only runs on Linux, as it uses podman to perform the push. GitHub's Ubuntu action runners come with Podman preinstalled. If you are not using those runners, you must first install Podman.

Action Inputs

Input Required Description
image Yes Name of the image you want to push.
tag No Image tag to push.
Defaults to latest.
registry Yes URL of the registry to push the image to.
Eg. quay.io/<username>
username Yes Username with which to authenticate to the registry.
password Yes Password, encrypted password, or access token with which to authenticate to the registry.

Action Outputs

This action produces these outputs which can be used for further processing in different Github action:

registry-path: The registry path to which the image was pushed.
For example, quay.io/username/spring-image:v1.

Examples

The example below shows how the push-to-registry action can be used to push an image created by the buildah-build action.

name: Build and Push Image
on: [push]

jobs:
  build:
    name: Build and push image
    runs-on: ubuntu-latest
    env:
      IMAGE_NAME: my-app
      IMAGE_TAG: latest

    steps:
    - uses: actions/checkout@v2

    - name: Build Image
      uses: redhat-actions/buildah-build@v1
      with:
        image: ${{ env.IMAGE_NAME }}
        tag: ${{ env.TAG }}
        dockerfiles: |
          ./Dockerfile

    - name: Push To Quay
      id: push-to-quay
      uses: redhat-actions/push-to-registry@v1
      with:
        image: ${{ env.IMAGE_NAME }}
        tag: ${{ env.TAG }}
        registry: ${{ secrets.QUAY_REPO }}
        username: ${{ secrets.QUAY_USERNAME }}
        password: ${{ secrets.QUAY_TOKEN }}

    # The output is stored in ${{ steps.push-to-quay.outputs.registry-path }}

Contributing

This is an open source project open to anyone. This project welcomes contributions and suggestions!

Feedback & Questions

If you discover an issue please file a bug in GitHub issues and we will fix it as soon as possible.

License

MIT, See LICENSE for more information.