2020-11-27 16:18:22 +05:30
|
|
|
# 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.
|
2021-01-19 20:54:49 +05:30
|
|
|
name: Test Push without image
|
|
|
|
on: [ push, workflow_dispatch ]
|
2020-11-27 16:18:22 +05:30
|
|
|
env:
|
2021-01-19 20:54:49 +05:30
|
|
|
IMAGE_NAME: myimage
|
2020-11-27 16:18:22 +05:30
|
|
|
IMAGE_REGISTRY: quay.io
|
|
|
|
IMAGE_TAG: latest
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Push image to Quay.io
|
2021-01-07 18:49:38 -05:00
|
|
|
runs-on: ubuntu-20.04
|
2020-11-27 16:18:22 +05:30
|
|
|
steps:
|
|
|
|
# Checkout push-to-registry action github repository
|
|
|
|
- name: Checkout Push to Registry action
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2021-01-19 20:54:49 +05:30
|
|
|
- name: Build Image using Docker
|
|
|
|
run: |
|
|
|
|
docker build -t ${{ env.IMAGE_NAME }}:latest -<<EOF
|
|
|
|
FROM busybox
|
|
|
|
RUN echo "hello world"
|
|
|
|
EOF
|
2020-11-27 16:18:22 +05:30
|
|
|
|
2020-12-18 19:34:40 +05:30
|
|
|
# Push the image to image registry
|
2020-11-27 16:18:22 +05:30
|
|
|
- name: Push To Quay
|
|
|
|
uses: ./
|
2021-01-07 18:49:38 -05:00
|
|
|
id: push
|
2020-11-27 16:18:22 +05:30
|
|
|
with:
|
|
|
|
image: ${{ env.IMAGE_NAME }}
|
|
|
|
tag: ${{ env.IMAGE_TAG }}
|
|
|
|
registry: ${{ env.IMAGE_REGISTRY }}/${{ secrets.REGISTRY_USER }}
|
|
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
2021-01-07 18:49:38 -05:00
|
|
|
|
|
|
|
- name: Echo outputs
|
|
|
|
run: |
|
|
|
|
echo "registry-path ${{ steps.push.outputs.registry-path }}"
|
|
|
|
echo "digest ${{ steps.push.outputs.digest }}"
|