From caa0ce318c857faccb2b2fd82af4e595b09052d1 Mon Sep 17 00:00:00 2001 From: "pierre.geeraert" Date: Tue, 22 Sep 2026 13:38:12 +0100 Subject: [PATCH] add the image downloader --- .gitea/workflows/image_downloader_runner.yaml | 46 +++++++++++-------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/.gitea/workflows/image_downloader_runner.yaml b/.gitea/workflows/image_downloader_runner.yaml index db04a8a..4c61529 100644 --- a/.gitea/workflows/image_downloader_runner.yaml +++ b/.gitea/workflows/image_downloader_runner.yaml @@ -8,35 +8,39 @@ jobs: Explore-Gitea-Actions: env: RUNNER_TOOL_CACHE: /toolcache - DEBUG: True - ALLOWED_HOSTS: "django.tryton.geeraert.eu" - NUMBERS: '1, 2, 3, 4, 5, 6, 7, 8, 9, 10' container: image: gitea.tryton.geeraert.eu/pi-ux-ce/custom-runner-debian-slim:1.0.6 volumes: - act-toolcache:/opt/hostedtoolcache # this is where Runner store their cache default runs-on: host-runner + outputs: + image_matrix: ${{ steps.set-matrix.outputs.images }} steps: - - - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." - - - name: 'Count from 1 to 10 with items from an environment variable' - uses: cliffano/command-loop-action@main - with: - items: ${{ env.NUMBERS }} - command: 'echo "Count $ITEM"' - - - name: Check out repository code + - name: Checkout repository uses: actions/checkout@v4 - - name: List files in the repository + - name: Parse image file into JSON array + id: set-matrix run: | - ls ${{ gitea.workspace }} - - - name: cat list - run: cat ${{ gitea.workspace }}/image_list.txt + # Read lines, remove empty lines/comments, and format as a JSON array + # e.g., ["ubuntu:latest", "alpine:3.18"] + JSON_ARRAY=$(jq -R -s -c 'split("\n") | map(select(length > 0 and (startswith("#") | not)))' image_list.txt) + + echo "Images found: $JSON_ARRAY" + echo "images=$JSON_ARRAY" >> $GITHUB_OUTPUT + # Job 2: Process each image in parallel matrix slots + process-images: + needs: setup + runs-on: host-runner + strategy: + # Prevents all other jobs from failing immediately if one image fails + fail-fast: false + matrix: + image: ${{ fromJSON(needs.setup.outputs.image_matrix) }} + + steps: - name: Login to gitea uses: docker/login-action@v3 with: @@ -44,6 +48,12 @@ jobs: username: ${{ secrets.USERNAME_GITEA }} password: ${{ secrets.PASSWORD_GITEA }} + + - name: Docker Pull + run: docker pull ${{ matrix.image }} + + + # - name: Push image # run: | # docker push gitea.tryton.geeraert.eu/pi-ux-ce/django-python:latest