<commit_before>name: Build & Deploy Docker Containers
on:
  # Build new Spack develop containers nightly.
  schedule:
    - cron: '34 0 * * *'
  # Let's also build & tag Spack containers on releases.
  release:
    types: [published]

jobs:
  deploy-images:
    runs-on: ubuntu-latest 
    strategy:
      # Even if one container fails to build we still want the others
      # to continue their builds.
      fail-fast: false
      # A matrix of Dockerfile paths, associated tags, and which architectures
      # they support.
      matrix:
        dockerfile: [[amazon-linux, amazonlinux-2.dockerfile, 'linux/amd64,linux/arm64'], 
                     [centos7, centos-7.dockerfile, 'linux/amd64,linux/arm64'],
                     [leap15, leap-15.dockerfile, 'linux/amd64,linux/arm64'],
                     [ubuntu-xenial, ubuntu-1604.dockerfile, 'linux/amd64,linux/arm64'],
                     [ubuntu-bionic, ubuntu-1804.dockerfile, 'linux/amd64,linux/arm64']]
    name: Build ${{ matrix.dockerfile[0] }}
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Set Container Tag Normal (Nightly)
        run: |
          container="ghcr.io/spack/${{ matrix.dockerfile[0]}}:latest"
          echo "container=${container}" >> $GITHUB_ENV
          echo "versioned=${container}" >> $GITHUB_ENV

        # On a new release create a container with the same tag as the release.
      - name: Set Container Tag on Release
        if: github.event_name == 'release'
        run: |
          versioned="ghcr.io/spack/${{matrix.dockerfile[0]}}:${GITHUB_REF##*/}"
          echo "versioned=${versioned}" >> $GITHUB_ENV

      - name: Check ${{ matrix.dockerfile[1] }} Exists
        run: |
          printf "Preparing to build ${{ env.container }} from ${{ matrix.dockerfile[1] }}"
          if [ ! -f "share/spack/docker/${{ matrix.dockerfile[1]}}" ]; then
              printf "Dockerfile ${{ matrix.dockerfile[0]}} does not exist"
              exit 1;
          fi

      - name: Log in to GitHub Container Registry
        # Don't log into registry on pull request.
        if: github.event_name != 'pull_request'
        uses: docker/login-action@v1
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Set up QEMU
        uses: docker/setup-qemu-action@v1

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1

      - name: Build ${{ matrix.dockerfile[1] }}
        uses: docker/build-push-action@v2
        with:
          file: share/spack/docker/${{matrix.dockerfile[1]}}
          platforms: ${{ matrix.dockerfile[2] }}
          push: false
          tags: |
            ${{ env.container }}
            ${{ env.versioned }}

      - name: Deploy ${{ matrix.dockerfile[1] }}
        # And don't push the container on a pull request.
        if: github.event_name != 'pull_request'
        run: docker push ghcr.io/spack/${{ matrix.dockerfile[0]}} --all-tags<commit_msg>Clean Up PR from Container Builder<commit_after>name: Build & Deploy Docker Containers
on:
  # Build new Spack develop containers nightly.
  schedule:
    - cron: '34 0 * * *'
  # Let's also build & tag Spack containers on releases.
  release:
    types: [published]

jobs:
  deploy-images:
    runs-on: ubuntu-latest 
    strategy:
      # Even if one container fails to build we still want the others
      # to continue their builds.
      fail-fast: false
      # A matrix of Dockerfile paths, associated tags, and which architectures
      # they support.
      matrix:
        dockerfile: [[amazon-linux, amazonlinux-2.dockerfile, 'linux/amd64,linux/arm64'], 
                     [centos7, centos-7.dockerfile, 'linux/amd64,linux/arm64'],
                     [leap15, leap-15.dockerfile, 'linux/amd64,linux/arm64'],
                     [ubuntu-xenial, ubuntu-1604.dockerfile, 'linux/amd64,linux/arm64'],
                     [ubuntu-bionic, ubuntu-1804.dockerfile, 'linux/amd64,linux/arm64']]
    name: Build ${{ matrix.dockerfile[0] }}
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Set Container Tag Normal (Nightly)
        run: |
          container="ghcr.io/spack/${{ matrix.dockerfile[0]}}:latest"
          echo "container=${container}" >> $GITHUB_ENV
          echo "versioned=${container}" >> $GITHUB_ENV

        # On a new release create a container with the same tag as the release.
      - name: Set Container Tag on Release
        if: github.event_name == 'release'
        run: |
          versioned="ghcr.io/spack/${{matrix.dockerfile[0]}}:${GITHUB_REF##*/}"
          echo "versioned=${versioned}" >> $GITHUB_ENV

      - name: Check ${{ matrix.dockerfile[1] }} Exists
        run: |
          printf "Preparing to build ${{ env.container }} from ${{ matrix.dockerfile[1] }}"
          if [ ! -f "share/spack/docker/${{ matrix.dockerfile[1]}}" ]; then
              printf "Dockerfile ${{ matrix.dockerfile[0]}} does not exist"
              exit 1;
          fi

      - name: Log in to GitHub Container Registry
        uses: docker/login-action@v1
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Set up QEMU
        uses: docker/setup-qemu-action@v1

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1

      - name: Build & Deploy ${{ matrix.dockerfile[1] }}
        uses: docker/build-push-action@v2
        with:
          file: share/spack/docker/${{matrix.dockerfile[1]}}
          platforms: ${{ matrix.dockerfile[2] }}
          push: true
          tags: |
            ${{ env.container }}
            ${{ env.versioned }}
{'fraction_non_alphanumeric': 0.12950391644908615, 'fraction_numerical': 0.019147084421235857, 'mean_word_length': 2.167585446527012, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '806709', 'n_tokens_mistral': 1884, 'n_tokens_neox': 1705, 'n_words': 436}