mirror of
https://github.com/redhat-actions/push-to-registry.git
synced 2025-05-07 13:09:54 +02:00
Add feature to push multiple tags of the image
Signed-off-by: divyansh42 <diagrawa@redhat.com>
This commit is contained in:
parent
23eb62f550
commit
73da53f4a0
6 changed files with 96 additions and 55 deletions
13
.github/workflows/verify-push.yaml
vendored
13
.github/workflows/verify-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: Test Push without image
|
||||
name: Test Build and Push
|
||||
on: [ push, workflow_dispatch ]
|
||||
env:
|
||||
IMAGE_NAME: myimage
|
||||
|
@ -19,10 +19,13 @@ jobs:
|
|||
|
||||
- name: Build Image using Docker
|
||||
run: |
|
||||
docker build -t ${{ env.IMAGE_NAME }}:latest -<<EOF
|
||||
docker build -t ${{ env.IMAGE_NAME }}:v1 -<<EOF
|
||||
FROM busybox
|
||||
RUN echo "hello world"
|
||||
EOF
|
||||
docker tag ${{ env.IMAGE_NAME }}:v1 ${{ env.IMAGE_NAME }}:v2
|
||||
docker tag ${{ env.IMAGE_NAME }}:v1 ${{ env.IMAGE_NAME }}:v3
|
||||
|
||||
|
||||
# Push the image to image registry
|
||||
- name: Push To Quay
|
||||
|
@ -30,12 +33,12 @@ jobs:
|
|||
id: push
|
||||
with:
|
||||
image: ${{ env.IMAGE_NAME }}
|
||||
tag: ${{ env.IMAGE_TAG }}
|
||||
tags: v1 v2 v3
|
||||
registry: ${{ env.IMAGE_REGISTRY }}/${{ secrets.REGISTRY_USER }}
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Echo outputs
|
||||
run: |
|
||||
echo "registry-path ${{ steps.push.outputs.registry-path }}"
|
||||
echo "digest ${{ steps.push.outputs.digest }}"
|
||||
echo "Digest: ${{ steps.push.outputs.digest }}"
|
||||
echo "Registry Paths: ${{ steps.push.outputs.registry-paths }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue