push-to-registry/.github/workflows/verify-push.yaml
Divyanshu Agrawal 23eb62f550
Solve issue when image is present in Podman and Docker both (#16)
* Solve issue when image is present in Podman and Docker both

If updated docker image is present in docker env then
docker image won't get used if image same name and tag
is already present in podman env.
To fix this, selected latest built image and removed the
image at the end from the podman env if image is pulled
from docker env.

Signed-off-by: divyansh42 <diagrawa@redhat.com>
2021-01-19 10:24:49 -05:00

41 lines
1.2 KiB
YAML

# 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
on: [ push, workflow_dispatch ]
env:
IMAGE_NAME: myimage
IMAGE_REGISTRY: quay.io
IMAGE_TAG: latest
jobs:
build:
name: Push image to Quay.io
runs-on: ubuntu-20.04
steps:
# Checkout push-to-registry action github repository
- name: Checkout Push to Registry action
uses: actions/checkout@v2
- name: Build Image using Docker
run: |
docker build -t ${{ env.IMAGE_NAME }}:latest -<<EOF
FROM busybox
RUN echo "hello world"
EOF
# Push the image to image registry
- name: Push To Quay
uses: ./
id: push
with:
image: ${{ env.IMAGE_NAME }}
tag: ${{ env.IMAGE_TAG }}
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 }}"