Update Docker Hub Description #25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright (C) 2025 Intel Corporation | |
| # SPDX-License-Identifier: Apache-2.0 | |
| name: Update Docker Hub Description | |
| on: | |
| schedule: | |
| - cron: "0 0 * * 0" | |
| workflow_dispatch: | |
| jobs: | |
| get-images-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| examples_json: ${{ steps.extract.outputs.examples_json }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Extract images info and generate JSON matrix | |
| id: extract | |
| run: | | |
| #!/bin/bash | |
| set -e | |
| images=$(awk -F'|' '/^\| *\[opea\// { | |
| gsub(/^ +| +$/, "", $2); | |
| gsub(/^ +| +$/, "", $4); | |
| gsub(/^ +| +$/, "", $5); | |
| # Extract the path portion of the dockerHub link from the Example Images column | |
| match($2, /\(https:\/\/hub\.docker\.com\/r\/[^)]*\)/); | |
| repository = substr($2, RSTART, RLENGTH); | |
| # Remove the prefix and the trailing right bracket | |
| sub(/^\(https:\/\/hub\.docker\.com\/r\//, "", repository); | |
| sub(/\)$/, "", repository); | |
| # Description Direct assignment | |
| description = $4; | |
| # Extract the content of the github link from the Readme column | |
| match($5, /\(https:\/\/github\.com\/[^)]*\)/); | |
| readme_url = substr($5, RSTART, RLENGTH); | |
| # Remove the prefix and the trailing right bracket | |
| sub(/^\(https:\/\/github\.com\//, "", readme_url); | |
| sub(/\)$/, "", readme_url); | |
| # Remove blob information, such as "blob/main/" or "blob/habana_main/" | |
| gsub(/blob\/[^/]+\//, "", readme_url); | |
| # Remove the organization name and keep only the file path, such as changing "opea-project/GenAIExamples/AudioQnA/README.md" to "GenAIExamples/AudioQnA/README.md" | |
| sub(/^[^\/]+\//, "", readme_url); | |
| # Generate JSON object string | |
| printf "{\"repository\":\"%s\",\"short-description\":\"%s\",\"readme-filepath\":\"%s\"}\n", repository, description, readme_url; | |
| }' docker_images_list.md) | |
| # Concatenate all JSON objects into a JSON array, using paste to separate them with commas | |
| json="[$(echo "$images" | paste -sd, -)]" | |
| echo "$json" | |
| # Set as output variable for subsequent jobs to use | |
| echo "::set-output name=examples_json::$json" | |
| check-images-matrix: | |
| runs-on: ubuntu-latest | |
| needs: get-images-matrix | |
| if: ${{ needs.get-images-matrix.outputs.examples_json != '' }} | |
| strategy: | |
| matrix: | |
| image: ${{ fromJSON(needs.get-images-matrix.outputs.examples_json) }} | |
| fail-fast: false | |
| steps: | |
| - name: Check dockerhub description | |
| run: | | |
| echo "dockerhub description for ${{ matrix.image.repository }}" | |
| echo "short-description: ${{ matrix.image.short-description }}" | |
| echo "readme-filepath: ${{ matrix.image.readme-filepath }}" | |
| dockerHubDescription: | |
| runs-on: ubuntu-latest | |
| needs: get-images-matrix | |
| if: ${{ needs.get-images-matrix.outputs.examples_json != '' }} | |
| strategy: | |
| matrix: | |
| image: ${{ fromJSON(needs.get-images-matrix.outputs.examples_json) }} | |
| fail-fast: false | |
| steps: | |
| - name: Checkout GenAIExamples | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: opea-project/GenAIExamples | |
| path: GenAIExamples | |
| - name: Checkout GenAIComps | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: opea-project/GenAIComps | |
| path: GenAIComps | |
| - name: Checkout vllm-openvino | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: vllm-project/vllm | |
| path: vllm | |
| - name: Checkout vllm-gaudi | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: HabanaAI/vllm-fork | |
| ref: habana_main | |
| path: vllm-fork | |
| - name: add dockerhub description | |
| uses: peter-evans/dockerhub-description@v4 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USER }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| repository: ${{ matrix.image.repository }} | |
| short-description: ${{ matrix.image.short-description }} | |
| readme-filepath: ${{ matrix.image.readme-filepath }} | |
| enable-url-completion: false |