<commit_before>name: Upload requested containers to gcr.io

on:
  pull_request:
    types: [labeled]
    paths:
      - '.github/workflows/docker-gcr.yml'
      - 'tf_sig_build_dockerfiles/**'
      - '!tf_sig_build_dockerfiles/README.md'

jobs:
  docker:
    if: ${{ github.event.label.name == 'build and push to gcr.io for staging' }}
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [python3.7, python3.8, python3.9]
    steps:
      -
        name: Checkout
        uses: actions/checkout@v2
      -
        name: Clear the build-and-push label
        uses: actions-ecosystem/action-remove-labels@v1
        with:
          labels: build and push to gcr.io for staging<commit_msg>Try out pushing to gcr.io<commit_after>name: Upload requested containers to gcr.io

on:
  pull_request:
    types: [labeled]
    paths:
      - '.github/workflows/docker-gcr.yml'
      - 'tf_sig_build_dockerfiles/**'
      - '!tf_sig_build_dockerfiles/README.md'

jobs:
  docker:
    if: ${{ github.event.label.name == 'build and push to gcr.io for staging' }}
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [python3.7, python3.8, python3.9]
    steps:
      -
        name: Checkout
        uses: actions/checkout@v2
      -
        name: Clear the build-and-push label
        uses: actions-ecosystem/action-remove-labels@v1
        with:
          labels: build and push to gcr.io for staging
      -
        uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
        with:
          service_account_key: ${{ secrets.GCP_CREDS }}
          project_id: tensorflow-sigs
          export_default_credentials: true 
      -
        name: Set up QEMU
        uses: docker/setup-qemu-action@v1
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      -
        name: Build and push
        id: docker_build
        uses: docker/build-push-action@v2
        with:
          push: true
          context: ./tf_sig_build_dockerfiles
          target: devel
          registry: gcr.io
          username: _json_key
          build-args: |
            PYTHON_VERSION=${{ matrix.python-version }}
          tags: |
            tensorflow-sigs/build:${{ github.event.number }}-${{ matrix.python-version }}
          cache-from: type=registry,ref=tensorflow-sigs/build:${{ github.event.number }}-${{ matrix.python-version }}
          cache-to: type=inline
      -
        name: Image digest
        run: echo ${{ steps.docker_build.outputs.digest }}
{'fraction_non_alphanumeric': 0.10979462875197472, 'fraction_numerical': 0.007503949447077409, 'mean_word_length': 2.0444711538461537, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '2991696', 'n_tokens_mistral': 841, 'n_tokens_neox': 801, 'n_words': 171}