add the image downloader
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user