<commit_before>name: Docker
on:
  pull_request:
  push:
    branches:
      - 'develop'
    tags:
      - 'v?[0-9]+.[0-9]+.[0-9]+'
env:
  TEST_TAG: etherpad/etherpad:test
jobs:
  docker:
    runs-on: ubuntu-latest
    steps:
      -
        name: Check out
        uses: actions/checkout@v3
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      -
        name: Build and export to Docker
        uses: docker/build-push-action@v2
        with:
          context: .
          load: true
          tags: ${{ env.TEST_TAG }}
          cache-from: type=gha
          cache-to: type=gha,mode=max
      -
        name: Set up Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 'lts/*'
          cache: 'npm'
          cache-dependency-path: |
            src/package-lock.json
            src/bin/doc/package-lock.json
      -
        name: Test
        run: |
          docker run --rm -d -p 9001:9001 ${{ env.TEST_TAG }}
          ./src/bin/installDeps.sh
          sleep 3
          (cd src && npm run test-container)
          git clean -dxf .
      -
        name: Docker meta
        if: github.event_name == 'push'
        id: meta
        uses: docker/metadata-action@v3
        with:
          images: etherpad/etherpad
          tags: |
            type=ref,event=branch
            type=semver,pattern={{version}}
            type=semver,pattern={{major}}.{{minor}}
            type=semver,pattern={{major}}
      -
        name: Log in to Docker Hub
        if: github.event_name == 'push'<commit_msg>ci: docker: Wait for container to be healthy<commit_after>name: Docker
on:
  pull_request:
  push:
    branches:
      - 'develop'
    tags:
      - 'v?[0-9]+.[0-9]+.[0-9]+'
env:
  TEST_TAG: etherpad/etherpad:test
jobs:
  docker:
    runs-on: ubuntu-latest
    steps:
      -
        name: Check out
        uses: actions/checkout@v3
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      -
        name: Build and export to Docker
        uses: docker/build-push-action@v2
        with:
          context: .
          load: true
          tags: ${{ env.TEST_TAG }}
          cache-from: type=gha
          cache-to: type=gha,mode=max
      -
        name: Set up Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 'lts/*'
          cache: 'npm'
          cache-dependency-path: |
            src/package-lock.json
            src/bin/doc/package-lock.json
      -
        name: Test
        run: |
          docker run --rm -d -p 9001:9001 --name test ${{ env.TEST_TAG }}
          ./src/bin/installDeps.sh
          while true; do
            echo "Waiting for Docker container to start..."
            status=$(docker container inspect -f '{{.State.Health.Status}}' test) || exit 1
            case ${status} in
              healthy) break;;
              starting) sleep 2;;
              *) printf %s\\n "unexpected status: ${status}" >&2; exit 1;;
            esac
          done
          (cd src && npm run test-container)
          git clean -dxf .
      -
        name: Docker meta
        if: github.event_name == 'push'
        id: meta
        uses: docker/metadata-action@v3
        with:
          images: etherpad/etherpad
          tags: |
            type=ref,event=branch
            type=semver,pattern={{version}}
            type=semver,pattern={{major}}.{{minor}}
            type=semver,pattern={{major}}
      -
        name: Log in to Docker Hub
        if: github.event_name == 'push'
{'fraction_non_alphanumeric': 0.1205733558178752, 'fraction_numerical': 0.012085441259134345, 'mean_word_length': 1.4663894663894663, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '746937', 'n_tokens_mistral': 1152, 'n_tokens_neox': 1095, 'n_words': 260}