GitHub Action to push a container image to an image registry.
Find a file
Tim Etchells 05f033c95a add badges
Signed-off-by: Tim Etchells <tetchell@redhat.com>
2020-11-17 10:01:23 -05:00
dist fix issue with pushing docker image 2020-11-16 14:06:29 +01:00
src fix issue with pushing docker image 2020-11-16 14:06:29 +01:00
.gitignore first implementation push to quay action 2020-11-07 13:04:04 +01:00
action.yml fix issue with pushing docker image 2020-11-16 14:06:29 +01:00
LICENSE first implementation push to quay action 2020-11-07 13:04:04 +01:00
package.json fix docker issue 2020-11-13 15:12:47 +01:00
README.md add badges 2020-11-17 10:01:23 -05:00
tsconfig.json first implementation push to quay action 2020-11-07 13:04:04 +01:00

push-to-registry

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.

Action Inputs

Input Required Description
image-to-push Yes Name of the image you want to push. Most likely the name you used to create the image in the previous step.
tag No Image tag to push.
Defaults to latest.
registry Yes URL of the registry to push the image to.
Eg. https://quay.io/<username>
username Yes Username with which to authenticate to the registry.
password Yes Password or personal access token with which to authenticate to the registry.

Examples

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

name: Build and Push Image
on: [push]

jobs:
  build:
    name: Build image
    runs-on: ubuntu-latest
    env:
      IMAGE_NAME: petclinic
      BUILT_JAR: "target/spring-petclinic-2.3.0.BUILD-SNAPSHOT.jar"

    steps:
    - name: Checkout
      uses: actions/checkout@v2

    - name: Maven
      run: |
        cd ${GITHUB_WORKSPACE}
        mvn package
    - name: Build Image
      uses: redhat-actions/buildah-action@0.0.1
      with:
        new-image-name: ${{ env.IMAGE_NAME }}
        content: |
          ${{ env.BUILT_JAR }}
        entrypoint: |
          java
          -jar
          ${{ env.BUILT_JAR }}
        port: 8080
    - name: Push To Quay
      uses: redhat-actions/push-to-registry@0.0.1
      with:
        image-to-push: ${{ env.IMAGE_NAME }}
        registry: ${{ secrets.QUAY_REPO }}
        username: ${{ secrets.QUAY_USERNAME }}
        password: ${{ secrets.QUAY_TOKEN }}

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.