<commit_before>name: Build and push CentOS7 images to Quay.io registry
on:
  push:
    branches:
      - master

jobs:
  build-and-push:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        version: [7.3]
    steps:
      - uses: actions/checkout@v2

      - name: Get base image name
        id: base-image-name
        run: |
          # This command returns row with BASE_IMAGE_NAME
          row=$(grep "BASE_IMAGE_NAME" Makefile)
          # Return only base image name
          BASE_IMAGE_ROW=${row/BASE_IMAGE_NAME = /}
          echo ::set-output name=image_name::$BASE_IMAGE_ROW

      - name: Get short version
        id: short_version
        run: |
          ver="${{ matrix.version }}"
          echo "::set-output name=SHORT_VER::${ver//./}"

      - name: Check if .exclude-centos7 is present in version directory
        id: check_exclude_centos7_file
        # https://github.com/marketplace/actions/file-existence
        uses: andstor/file-existence-action@v1
        with:
          files: "${{ matrix.version }}/.exclude-centos7"

      - name: Build CentOS7 image
        if: steps.check_exclude_centos7_file.outputs.files_exists == 'false'
        id: build-image
        # https://github.com/marketplace/actions/buildah-build
        uses: redhat-actions/buildah-build@v2
        with:
          dockerfiles: ${{ matrix.version }}/Dockerfile
          image: ${{ steps.base-image-name.outputs.image_name}}-${{ steps.short_version.outputs.SHORT_VER }}-centos7
          context: ${{ matrix.version }}
          tags: latest 1 ${{ github.sha }}

      - name: Push CentOS7 image to Quay.io
        if: steps.check_exclude_centos7_file.outputs.files_exists == 'false'
        id: push-to-quay
        uses: redhat-actions/push-to-registry@v2.2
        with:
          image: ${{ steps.build-image.outputs.image }}
          tags: ${{ steps.build-image.outputs.tags }}
          registry: quay.io/centos7
          username: ${{ secrets.QUAY_IMAGE_BUILDER_USERNAME }}
          password: ${{ secrets.QUAY_IMAGE_BUILDER_TOKEN }}

      - name: Print image url
        run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"
<commit_msg>Add version 7.4 into build and push github actions<commit_after>name: Build and push CentOS7 images to Quay.io registry
on:
  push:
    branches:
      - master

jobs:
  build-and-push:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        version: [7.3, 7.4]
    steps:
      - uses: actions/checkout@v2

      - name: Get base image name
        id: base-image-name
        run: |
          # This command returns row with BASE_IMAGE_NAME
          row=$(grep "BASE_IMAGE_NAME" Makefile)
          # Return only base image name
          BASE_IMAGE_ROW=${row/BASE_IMAGE_NAME = /}
          echo ::set-output name=image_name::$BASE_IMAGE_ROW

      - name: Get short version
        id: short_version
        run: |
          ver="${{ matrix.version }}"
          echo "::set-output name=SHORT_VER::${ver//./}"

      - name: Check if .exclude-centos7 is present in version directory
        id: check_exclude_centos7_file
        # https://github.com/marketplace/actions/file-existence
        uses: andstor/file-existence-action@v1
        with:
          files: "${{ matrix.version }}/.exclude-centos7"

      - name: Build CentOS7 image
        if: steps.check_exclude_centos7_file.outputs.files_exists == 'false'
        id: build-image
        # https://github.com/marketplace/actions/buildah-build
        uses: redhat-actions/buildah-build@v2
        with:
          dockerfiles: ${{ matrix.version }}/Dockerfile
          image: ${{ steps.base-image-name.outputs.image_name}}-${{ steps.short_version.outputs.SHORT_VER }}-centos7
          context: ${{ matrix.version }}
          tags: latest 1 ${{ github.sha }}

      - name: Push CentOS7 image to Quay.io
        if: steps.check_exclude_centos7_file.outputs.files_exists == 'false'
        id: push-to-quay
        uses: redhat-actions/push-to-registry@v2.2
        with:
          image: ${{ steps.build-image.outputs.image }}
          tags: ${{ steps.build-image.outputs.tags }}
          registry: quay.io/centos7
          username: ${{ secrets.QUAY_IMAGE_BUILDER_USERNAME }}
          password: ${{ secrets.QUAY_IMAGE_BUILDER_TOKEN }}

      - name: Print image url
        run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"

{'fraction_non_alphanumeric': 0.11933876811594203, 'fraction_numerical': 0.009057971014492754, 'mean_word_length': 2.228801169590643, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4921017', 'n_tokens_mistral': 1404, 'n_tokens_neox': 1346, 'n_words': 289}