add the image downloader
This commit is contained in:
@@ -8,35 +8,39 @@ jobs:
|
|||||||
Explore-Gitea-Actions:
|
Explore-Gitea-Actions:
|
||||||
env:
|
env:
|
||||||
RUNNER_TOOL_CACHE: /toolcache
|
RUNNER_TOOL_CACHE: /toolcache
|
||||||
DEBUG: True
|
|
||||||
ALLOWED_HOSTS: "django.tryton.geeraert.eu"
|
|
||||||
NUMBERS: '1, 2, 3, 4, 5, 6, 7, 8, 9, 10'
|
|
||||||
|
|
||||||
container:
|
container:
|
||||||
image: gitea.tryton.geeraert.eu/pi-ux-ce/custom-runner-debian-slim:1.0.6
|
image: gitea.tryton.geeraert.eu/pi-ux-ce/custom-runner-debian-slim:1.0.6
|
||||||
volumes:
|
volumes:
|
||||||
- act-toolcache:/opt/hostedtoolcache # this is where Runner store their cache default
|
- act-toolcache:/opt/hostedtoolcache # this is where Runner store their cache default
|
||||||
runs-on: host-runner
|
runs-on: host-runner
|
||||||
|
outputs:
|
||||||
|
image_matrix: ${{ steps.set-matrix.outputs.images }}
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
- 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
|
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: List files in the repository
|
- name: Parse image file into JSON array
|
||||||
|
id: set-matrix
|
||||||
run: |
|
run: |
|
||||||
ls ${{ gitea.workspace }}
|
# 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)
|
||||||
|
|
||||||
- name: cat list
|
echo "Images found: $JSON_ARRAY"
|
||||||
run: cat ${{ gitea.workspace }}/image_list.txt
|
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
|
- name: Login to gitea
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
@@ -44,6 +48,12 @@ jobs:
|
|||||||
username: ${{ secrets.USERNAME_GITEA }}
|
username: ${{ secrets.USERNAME_GITEA }}
|
||||||
password: ${{ secrets.PASSWORD_GITEA }}
|
password: ${{ secrets.PASSWORD_GITEA }}
|
||||||
|
|
||||||
|
|
||||||
|
- name: Docker Pull
|
||||||
|
run: docker pull ${{ matrix.image }}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# - name: Push image
|
# - name: Push image
|
||||||
# run: |
|
# run: |
|
||||||
# docker push gitea.tryton.geeraert.eu/pi-ux-ce/django-python:latest
|
# docker push gitea.tryton.geeraert.eu/pi-ux-ce/django-python:latest
|
||||||
|
|||||||
Reference in New Issue
Block a user