2020-11-13 14:52:22 +00:00
# push-to-registry
2020-11-17 19:19:05 +00:00
[](https://github.com/redhat-actions/push-to-registry/actions?query=workflow%3A%22Verify+Bundle%22)
2020-11-17 03:37:48 +00:00
[](https://github.com/redhat-actions/push-to-registry/tags)
[](./LICENSE)
[](./dist)
2020-11-17 03:34:16 +00:00
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.
2020-11-13 14:52:22 +00:00
## Action Inputs
< table >
< thead >
< tr >
2020-11-17 03:34:16 +00:00
< th > Input< / th >
< th > Required< / th >
2020-11-13 14:52:22 +00:00
< th > Description< / th >
< / tr >
< / thead >
< tr >
2020-11-17 19:19:05 +00:00
< td > image< / td >
2020-11-17 03:34:16 +00:00
< td > Yes< / td >
< td >
2020-11-18 00:00:31 +00:00
Name of the image you want to push.
2020-11-17 03:34:16 +00:00
< / td >
2020-11-13 14:52:22 +00:00
< / tr >
< tr >
< td > tag< / td >
2020-11-17 03:34:16 +00:00
< td > No< / td >
< td >
Image tag to push.< br >
Defaults to < code > latest< / code > .
< / td >
2020-11-13 14:52:22 +00:00
< / tr >
< tr >
< td > registry< / td >
2020-11-17 03:34:16 +00:00
< td > Yes< / td >
< td > URL of the registry to push the image to.< br >
2020-11-18 00:00:31 +00:00
Eg. < code > quay.io/< username> < / code > < / td >
2020-11-13 14:52:22 +00:00
< / tr >
< tr >
< td > username< / td >
2020-11-17 03:34:16 +00:00
< td > Yes< / td >
< td > Username with which to authenticate to the registry.< / td >
2020-11-13 14:52:22 +00:00
< / tr >
< tr >
< td > password< / td >
2020-11-17 03:34:16 +00:00
< td > Yes< / td >
< td > Password or personal access token with which to authenticate to the registry.< / td >
2020-11-13 14:52:22 +00:00
< / tr >
< / table >
2020-11-16 13:06:29 +00:00
## Examples
The example below shows how the `push-to-registry` action can be used to push an image created by the [`buildah-action` ](https://github.com/redhat-actions/buildah-action ) in an early step.
2020-11-17 03:34:16 +00:00
```yaml
name: Build and Push Image
2020-11-16 13:06:29 +00:00
on: [push]
jobs:
build:
name: Build image
runs-on: ubuntu-latest
2020-11-17 03:34:16 +00:00
env:
IMAGE_NAME: petclinic
BUILT_JAR: "target/spring-petclinic-2.3.0.BUILD-SNAPSHOT.jar"
2020-11-16 13:06:29 +00:00
steps:
2020-11-18 00:00:31 +00:00
- uses: actions/checkout@v2
- run: mvn package
2020-11-16 13:06:29 +00:00
2020-11-17 03:34:16 +00:00
- name: Build Image
2020-11-16 13:06:29 +00:00
uses: redhat-actions/buildah-action@0.0.1
with:
2020-11-17 03:34:16 +00:00
new-image-name: ${{ env.IMAGE_NAME }}
2020-11-16 13:06:29 +00:00
content: |
2020-11-17 03:34:16 +00:00
${{ env.BUILT_JAR }}
2020-11-16 13:06:29 +00:00
entrypoint: |
2020-11-17 03:34:16 +00:00
java
2020-11-16 13:06:29 +00:00
-jar
2020-11-17 03:34:16 +00:00
${{ env.BUILT_JAR }}
2020-11-16 13:06:29 +00:00
port: 8080
- name: Push To Quay
2020-11-18 00:00:31 +00:00
uses: redhat-actions/push-to-registry@v1
2020-11-16 13:06:29 +00:00
with:
2020-11-17 19:19:05 +00:00
image: ${{ env.IMAGE_NAME }}
2020-11-16 13:06:29 +00:00
registry: ${{ secrets.QUAY_REPO }}
username: ${{ secrets.QUAY_USERNAME }}
2020-11-17 03:34:16 +00:00
password: ${{ secrets.QUAY_TOKEN }}
2020-11-16 13:06:29 +00:00
```
2020-11-13 14:52:22 +00:00
## 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 ](https://github.com/redhat-actions/push-to-registry/issues ) and we will fix it as soon as possible.
## License
2020-11-17 03:34:16 +00:00
MIT, See [LICENSE ](./LICENSE ) for more information.