<commit_before><commit_msg>Add nightly re-build of tagged images<commit_after>name: Build and Tag Nightly

on:
  workflow_dispatch:
  schedule:
    - cron: '21 10 * * *' # daily, in the morning (UTC)

jobs:
  tags:
    runs-on: ubuntu-latest
    name: Extract Semvar Tags
    outputs:
      latestTag: ${{ steps.tag.outputs.latestTag }}
      major: ${{ steps.tag.outputs.major }}
      minor: ${{ steps.tag.outputs.minor }}
      patch: ${{ steps.tag.outputs.patch }}
    steps:
    - uses: actions/checkout@v3
      with:
          fetch-depth: 0
          token: ${{ secrets.ZORGBORT_TOKEN }}
    - id: tag
      run: |
        LATEST_TAG=$(git describe --tags --abbrev=0)
        echo ${LATEST_TAG}
        echo "::set-output name=latestTag::${LATEST_TAG}"
        MAJOR_VERSION=$(echo $LATEST_TAG | sed -rn 's#^(v3)\.([0-9]+)\.([0-9]+)$#\1#p')
        echo ${MAJOR_VERSION}
        echo "::set-output name=major::${MAJOR_VERSION}"
        MINOR_VERSION=$(echo $LATEST_TAG | sed -rn 's#^(v3)\.([0-9]+)\.([0-9]+)$#\1.\2#p')
        echo ${MINOR_VERSION}
        echo "::set-output name=minor::${MINOR_VERSION}"
        PATCH_VERSION=$(echo $LATEST_TAG | sed -rn 's#^(v3)\.([0-9]+)\.([0-9]+)$#\1.\2.\3#p')
        echo ${PATCH_VERSION}
        echo "::set-output name=patch::${PATCH_VERSION}"
  deploy-docker-containers:
    needs: tags
    name: Docker Registry (${{needs.tags.outputs.major}},${{needs.tags.outputs.minor}},${{needs.tags.outputs.patch}})
    runs-on: ubuntu-latest
    strategy:
      matrix:
        image:
          - php-apache
          - nginx
          - fpm
          - fpm-dev
          - admin
          - update-frontend
          - consume-messages
          - mysql
          - mysql-demo
          - elasticsearch
    steps:
    - uses: actions/checkout@v3
      with:
          ref: ${{needs.tags.outputs.latestTag}}
    - name: Set up QEMU
      uses: docker/setup-qemu-action@v2
      with:
        image: tonistiigi/binfmt:latest
        platforms: linux/amd64,linux/arm64
    - name: Set up Docker Buildx
      uses: docker/setup-buildx-action@v2
    - name: Login to DockerHub
      uses: docker/login-action@v2
      with:
        username: zorgbort
        password: ${{ secrets.ZORGBORT_DOCKER_TOKEN }}
    - name: ${{ matrix.image }} to Docker Registry
      uses: docker/build-push-action@v3
      with:
        tags: ilios/${{ matrix.image }}:${{needs.tags.outputs.major}},ilios/${{ matrix.image }}:${{needs.tags.outputs.minor}},ilios/${{ matrix.image }}:${{needs.tags.outputs.patch}}
        build-args: ILIOS_VERSION=${{needs.tags.outputs.patch}}
        target: ${{ matrix.image }}
        push: true
        platforms: linux/amd64,linux/arm64

{'fraction_non_alphanumeric': 0.16648086213303603, 'fraction_numerical': 0.015235971757710888, 'mean_word_length': 2.2829268292682925, 'pattern_counts': {'":': 4, '<': 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': '3293881', 'n_tokens_mistral': 963, 'n_tokens_neox': 911, 'n_words': 169}