<commit_before>name: Continuous Delivery

on:
  schedule:
    - cron: "45 4 16 * *" # Thursday
  workflow_dispatch:
    inputs:
      none:
        description: "Run Nightlies Tests Manually"
        required: false

jobs:
  deploy-syft-beta:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          token: ${{ secrets.SYFT_BUMP_TOKEN }}
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: "3.x"
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install --upgrade setuptools wheel twine tox bump2version
#       - name: Bump the Version
#         run: |
#           ls **/VERSION | xargs -I {} python {}
#           cat packages/grid/devspace.yaml | grep '0\.'
#           bump2version prenum --allow-dirty --no-commit
#           tox -e lint || true
#           ls **/VERSION | xargs -I {} python {}
#           cat packages/grid/devspace.yaml | grep '0\.'
#       - name: Commit changes
#         uses: EndBug/add-and-commit@v7
#         with:
#           author_name: <NAME>
#           author_email: <EMAIL>
#           message: "bump version"
#           add: "['.bumpversion.cfg', 'VERSION', 'packages/grid/VERSION', 'packages/grid/devspace.yaml', 'packages/syft/src/syft/VERSION', 'packages/grid/backend/pyproject.toml', 'packages/grid/frontend/package.json', 'packages/grid/frontend/src/pages/_domain/login.tsx', 'packages/syft/src/syft/__init__.py']"

#       - name: Build and publish
#         env:
#           TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
#           TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
#         run: |
#           tox -e syft.publish
#           twine upload packages/syft/dist/*

      - name: Set Grid package version
        run: echo "GRID_VERSION=$(python packages/grid/VERSION)" >> $GITHUB_ENV

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

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

      - name: Login to Docker
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKER_LOGIN }}
          password: ${{ secrets.DOCKER_PASSWORD }}

      - name: Set Env for `grid backend`
        working-directory: ./packages
        env:
          IMAGE_URI: openmined/grid-backend
        run: |
          export DOCKER_URI=$IMAGE_URI:$GRID_VERSION
          export DOCKER_URI_LATEST=$IMAGE_URI:latest
          echo "DOCKER_URI=$DOCKER_URI" >> $GITHUB_ENV
          echo "DOCKER_URI_LATEST=$DOCKER_URI_LATEST" >> $GITHUB_ENV

      - name: check URI
        run: |
          echo ${{env.DOCKER_URI}}
          echo ${{env.DOCKER_URI_LATEST}}



      # - name: Docker meta
      #   id: meta_grid_backend
      #   uses: docker/metadata-action@v3
      #   with:
      #     images: openmined/grid-backend
      #     tags: |
      #       type=raw,value=${{ env.GRID_VERSION }}
      #       type=raw,value=latest

      # - name: Build and push `grid-backend` image to DockerHub
      #   uses: docker/build-push-action@v2
      #   with:
      #     context: .
      #     file: grid/backend/backend.dockerfile
      #     push: true
      #     tags: ${{ steps.meta_grid_backend.outputs.tags }}

      # - name: Build and push `grid-backend` image to DockerHub<commit_msg>debugging cd actions<commit_after>name: Continuous Delivery

on:
  schedule:
    - cron: "45 4 16 * *" # Thursday
  workflow_dispatch:
    inputs:
      none:
        description: "Run Nightlies Tests Manually"
        required: false

jobs:
  deploy-syft-beta:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          token: ${{ secrets.SYFT_BUMP_TOKEN }}
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: "3.x"
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install --upgrade setuptools wheel twine tox bump2version
#       - name: Bump the Version
#         run: |
#           ls **/VERSION | xargs -I {} python {}
#           cat packages/grid/devspace.yaml | grep '0\.'
#           bump2version prenum --allow-dirty --no-commit
#           tox -e lint || true
#           ls **/VERSION | xargs -I {} python {}
#           cat packages/grid/devspace.yaml | grep '0\.'
#       - name: Commit changes
#         uses: EndBug/add-and-commit@v7
#         with:
#           author_name: <NAME>
#           author_email: <EMAIL>
#           message: "bump version"
#           add: "['.bumpversion.cfg', 'VERSION', 'packages/grid/VERSION', 'packages/grid/devspace.yaml', 'packages/syft/src/syft/VERSION', 'packages/grid/backend/pyproject.toml', 'packages/grid/frontend/package.json', 'packages/grid/frontend/src/pages/_domain/login.tsx', 'packages/syft/src/syft/__init__.py']"

#       - name: Build and publish
#         env:
#           TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
#           TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
#         run: |
#           tox -e syft.publish
#           twine upload packages/syft/dist/*

      - name: Set Grid package version
        run: echo "GRID_VERSION=$(python packages/grid/VERSION)" >> $GITHUB_ENV

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

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

      - name: Login to Docker
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKER_LOGIN }}
          password: ${{ secrets.DOCKER_PASSWORD }}

      - name: Set Env for `grid backend`
        working-directory: ./packages
        env:
          IMAGE_URI: openmined/grid-backend
        run: |
          export DOCKER_URI=$IMAGE_URI:$GRID_VERSION
          export DOCKER_URI_LATEST=$IMAGE_URI:latest
          echo "DOCKER_URI=$DOCKER_URI" >> $GITHUB_ENV
          echo "DOCKER_URI_LATEST=$DOCKER_URI_LATEST" >> $GITHUB_ENV

      - name: check URI
        run: |
          echo ${{env.DOCKER_URI}}
          echo ${{env.DOCKER_URI_LATEST}}



      # - name: Docker meta
      #   id: meta_grid_backend
      #   uses: docker/metadata-action@v3
      #   with:
      #     images: openmined/grid-backend
      #     tags: |
      #       type=raw,value=${{ env.GRID_VERSION }}
      #       type=raw,value=latest

      - name: Build and push `grid-backend` image to DockerHub
        uses: docker/build-push-action@v2
        with:
          context: .
          file: grid/backend/backend.dockerfile
          push: true
          tags: ${{env.DOCKER_URI}}, ${{env.DOCKER_URI_LATEST}}

      # - name: Build and push `grid-backend` image to DockerHub
{'fraction_non_alphanumeric': 0.1206819866567828, 'fraction_numerical': 0.005337286879169755, 'mean_word_length': 1.9561787905346188, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, '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': '119314', 'n_tokens_mistral': 2225, 'n_tokens_neox': 2119, 'n_words': 468}