From fc9228cf4318f6c0d44fea4273caae488538b810 Mon Sep 17 00:00:00 2001 From: buuhsmead Date: Thu, 12 Oct 2023 13:18:47 +0200 Subject: [PATCH] Correcting for PR comments --- .github/workflows/fc-asciidoctor-pr.yaml | 13 ++++++++----- .github/workflows/fc-asciidoctor-publish.yaml | 17 ++++++----------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/fc-asciidoctor-pr.yaml b/.github/workflows/fc-asciidoctor-pr.yaml index a926cfc6d..17aadaa89 100644 --- a/.github/workflows/fc-asciidoctor-pr.yaml +++ b/.github/workflows/fc-asciidoctor-pr.yaml @@ -12,11 +12,13 @@ jobs: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v1 - - name: Check and verify version.json - id: check_version - run: | - echo -n ::set-output name=IMAGE_TAGS:: - echo $(jq -r '.version' ${context}/version.json) + + - name: Get image tags + id: image_tags + uses: redhat-cop/github-actions/get-image-version@master + with: + IMAGE_CONTEXT_DIR: ${{ env.CONTEXT_DIR }} + - name: Build image uses: redhat-actions/buildah-build@v2 with: @@ -26,6 +28,7 @@ jobs: image: ${{ env.image_name }} oci: true tags: ${{ steps.check_version.outputs.IMAGE_TAGS }} + - name: Test image run: | echo "Running: podman run ${image_name}:${{ steps.check_version.outputs.IMAGE_TAGS }} git --version" diff --git a/.github/workflows/fc-asciidoctor-publish.yaml b/.github/workflows/fc-asciidoctor-publish.yaml index b63b80691..811fd6081 100644 --- a/.github/workflows/fc-asciidoctor-publish.yaml +++ b/.github/workflows/fc-asciidoctor-publish.yaml @@ -16,19 +16,13 @@ jobs: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@master + - name: Get image tags id: image_tags - run: | - echo -n ::set-output name=IMAGE_TAGS:: - VERSION=$(jq -r '.version' ${context}/version.json) - TAGS=('latest') - if [ "${VERSION}" ] && [ "${VERSION}" != "latest" ]; then - TAGS+=("${VERSION}") - fi - if [[ "${GITHUB_REF}" =~ refs/tags/(.*) ]]; then - TAGS+=("git-${BASH_REMATCH[1]}") - fi - echo "${TAGS[*]}" + uses: redhat-cop/github-actions/get-image-version@master + with: + IMAGE_CONTEXT_DIR: ${{ env.CONTEXT_DIR }} + - name: Build image id: build_image uses: redhat-actions/buildah-build@v2 @@ -38,6 +32,7 @@ jobs: ./${{ env.context }}/Dockerfile image: ${{ env.image_name }} tags: "${{ steps.image_tags.outputs.IMAGE_TAGS }}" + - name: Push to Quay id: push_to_quay uses: redhat-actions/push-to-registry@v2