<commit_before>name: Build Gitpod Docker image

on:
  push:
    branches:
      - main
      
jobs:
  build:
    name: Build Gitpod Docker image 
    runs-on: ubuntu-latest
    environment: numpy-dev
    if: "github.repository_owner == 'numpy' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip github]')"
    steps:
      - name: Clone repository
        uses: actions/checkout@v2
      - name: Lint Docker 
        uses: brpaz/hadolint-action@v1.2.1
        with: 
          dockerfile: ./tools/gitpod/gitpod.Dockerfile
      - name: Get refs
        shell: bash
        run: |
          export raw_branch=${GITHUB_REF#refs/heads/}
          echo "::set-output name=branch::${raw_branch//\//-}"
          echo "::set-output name=date::$(date +'%Y%m%d')"
          echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
        id: getrefs
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      - name: Cache Docker layers
        uses: actions/cache@v2
        with:
          path: /tmp/.buildx-cache
          key: ${{ runner.os }}-buildx-${{ github.sha }}
          restore-keys: ${{ runner.os }}-buildx-
      - name: Login to Docker Hub
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      - name: Build and push
        id: docker_build
        uses: docker/build-push-action@v2
        with:
          context: "."
          file: "./tools/gitpod/gitpod.Dockerfile"
          push: ${{ github.event_name != 'pull_request' }}
          cache-from: type=local,src=/tmp/.buildx-cache
          cache-to: type=local,dest=/tmp/.buildx-cache
          tags: |
            numpy/numpy-gitpod:${{ steps.getrefs.outputs.date }}-${{ steps.getrefs.outputs.branch}}-${{ steps.getrefs.outputs.sha8 }}, numpy/numpy-gitpod:latest
      - name: Image digest 
        # Return details of the image build: sha and shell
        run: echo ${{ steps.docker_build.outputs.digest }}<commit_msg>BUG: Use larger fetch depth in gitpod.yml<commit_after>name: Build Gitpod Docker image

on:
  push:
    branches:
      - main

jobs:
  build:
    name: Build Gitpod Docker image
    runs-on: ubuntu-latest
    environment: numpy-dev
    if: "github.repository_owner == 'numpy' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip github]')"
    steps:
      - name: Clone repository
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Lint Docker
        uses: brpaz/hadolint-action@v1.2.1
        with:
          dockerfile: ./tools/gitpod/gitpod.Dockerfile
      - name: Get refs
        shell: bash
        run: |
          export raw_branch=${GITHUB_REF#refs/heads/}
          echo "::set-output name=branch::${raw_branch//\//-}"
          echo "::set-output name=date::$(date +'%Y%m%d')"
          echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
        id: getrefs
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      - name: Cache Docker layers
        uses: actions/cache@v2
        with:
          path: /tmp/.buildx-cache
          key: ${{ runner.os }}-buildx-${{ github.sha }}
          restore-keys: ${{ runner.os }}-buildx-
      - name: Login to Docker Hub
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      - name: Build and push
        id: docker_build
        uses: docker/build-push-action@v2
        with:
          context: "."
          file: "./tools/gitpod/gitpod.Dockerfile"
          push: ${{ github.event_name != 'pull_request' }}
          cache-from: type=local,src=/tmp/.buildx-cache
          cache-to: type=local,dest=/tmp/.buildx-cache
          tags: |
            numpy/numpy-gitpod:${{ steps.getrefs.outputs.date }}-${{ steps.getrefs.outputs.branch}}-${{ steps.getrefs.outputs.sha8 }}, numpy/numpy-gitpod:latest
      - name: Image digest
        # Return details of the image build: sha and shell
        run: echo ${{ steps.docker_build.outputs.digest }}
{'fraction_non_alphanumeric': 0.1432500573000229, 'fraction_numerical': 0.005730002292000917, 'mean_word_length': 2.19941348973607, 'pattern_counts': {'":': 6, '<': 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': '6584463', 'n_tokens_mistral': 1455, 'n_tokens_neox': 1380, 'n_words': 297}