mirror of
https://github.com/redhat-actions/push-to-registry.git
synced 2025-02-22 18:21:20 +01:00
Cleanup Workflow
Signed-off-by: divyansh42 <diagrawa@redhat.com>
This commit is contained in:
parent
889c4fd0f3
commit
f89a81fade
1 changed files with 1 additions and 22 deletions
23
.github/workflows/verify-push.yaml
vendored
23
.github/workflows/verify-push.yaml
vendored
|
@ -13,36 +13,15 @@ jobs:
|
|||
name: Push image to Quay.io
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# Fetch name of the Forked Repository with Branch
|
||||
# if workflow is triggered from pull request
|
||||
- name: Fetch PR head repo and branch name
|
||||
if: github.event_name == 'pull_request'
|
||||
run: |
|
||||
HEAD_REPO_NAME=$(jq -r '.pull_request.head.repo.full_name' "$GITHUB_EVENT_PATH")
|
||||
echo "PR head repo: $HEAD_REPO_NAME"
|
||||
echo "repo=$HEAD_REPO_NAME" >> $GITHUB_ENV
|
||||
echo "branch=$GITHUB_HEAD_REF" >> $GITHUB_ENV
|
||||
|
||||
# Extract repository name with branch
|
||||
- name: Fetch Repository name with branch
|
||||
if: github.event_name != 'pull_request'
|
||||
shell: bash
|
||||
run: |
|
||||
echo "repo=$GITHUB_REPOSITORY" >> $GITHUB_ENV
|
||||
echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
|
||||
|
||||
# Checkout push-to-registry action github repository
|
||||
- name: Checkout Push to Registry action
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: ${{ env.repo }}
|
||||
ref: ${{ env.branch }}
|
||||
|
||||
# Pull hello-world image to push in next step
|
||||
- name: Pull Hello world image
|
||||
run: docker pull ${{ env.IMAGE_NAME }}
|
||||
|
||||
# Push the image to image registry
|
||||
# Push the image to image registry
|
||||
- name: Push To Quay
|
||||
uses: ./
|
||||
with:
|
||||
|
|
Loading…
Add table
Reference in a new issue