Files
computer-playbook/.github/workflows/cron-images-mirror-all.yml
kevinveenbirkenbachandClaude Opus 5.5 b055eece05 feat(ci): keep GitHub-hosted runner labels current through the updater
The workflows pin `runs-on: ubuntu-NN.NN`, so no job moves to a new Ubuntu
release behind our back, but nothing raised the pin either. A sixth job of
`🔄 Update versions` closes that: `utils/update/runner.py` reads the image
table of actions/runner-images, takes the newest x64 Ubuntu label whose
image carries no preview or beta badge, and raises every older bare
`runs-on: ubuntu-NN.NN` to it; arch-suffixed labels stay untouched. The job
opens the change as one PR over `.github/workflows`, so its CI run tests
the new image before it reaches main.

This commit carries the updater's first result: every job now runs on
ubuntu-26.04 (49 `runs-on`).

actionlint 1.7.12, the newest release, does not know `ubuntu-26.04` yet
(rhysd/actionlint#682, fix proposed in rhysd/actionlint#743), so
`.github/actionlint.yaml` declares the label until a release knows it.

act maps each `ubuntu-NN.NN` label the workflows use to the local platform
image, derived from `.github/workflows`, instead of a fixed list that did
not know ubuntu-26.04.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-19 16:56:52 +02:00

120 lines
3.5 KiB
YAML

name: "🪞 Mirror all images"
run-name: "${{ github.event_name == 'schedule' && '⏰ ' || '' }}🪞 Mirror all images"
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
ghcr_namespace:
description: "🏛️ GHCR namespace/org (default: repository owner)"
required: false
type: string
ghcr_prefix:
description: "🏷️ GHCR repo prefix (default: mirror)"
required: false
default: "mirror"
type: string
repo_root:
description: "📁 Repository root path (default: .)"
required: false
default: "."
type: string
images_per_hour:
description: "⏱️ Optional throttle: max images mirrored per hour"
required: false
type: string
workflow_call:
inputs:
ghcr_namespace:
description: "GHCR namespace/org (default: repository owner)"
required: false
type: string
ghcr_prefix:
description: "GHCR repo prefix (default: mirror)"
required: false
type: string
default: "mirror"
repo_root:
description: "Repository root path (default: .)"
required: false
type: string
default: "."
images_per_hour:
description: "Optional throttle: max images mirrored per hour"
required: false
type: string
secrets:
DOCKERHUB_USERNAME:
required: false
DOCKERHUB_TOKEN:
required: false
permissions:
contents: read
concurrency:
group: mirror-images-${{ github.repository }}-${{ github.ref_name }}
cancel-in-progress: false
jobs:
sync:
name: 🪞 Mirror
runs-on: ubuntu-26.04
permissions:
contents: read
packages: write
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
IMAGES_PER_HOUR: ${{ github.event.inputs.images_per_hour || inputs.images_per_hour || '50' }}
steps:
- name: ⬇️ Checkout
uses: actions/checkout@v7.0.0
- name: 🔍 Resolve GHCR namespace and repository
id: vars
shell: bash
env:
GHCR_NAMESPACE_INPUT: ${{ inputs.ghcr_namespace || '' }}
run: bash scripts/meta/resolve/ghcr/namespace_and_repository.sh
- name: 🔧 Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: pip
cache-dependency-path: pyproject.toml
- name: 📦 Install Python deps
run: PYTHON=python bash scripts/install/python.sh
- name: 📦 Install skopeo
run: ./scripts/install/apt.sh skopeo
- name: 🔑 Login to Docker Hub (optional)
if: ${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ env.DOCKERHUB_TOKEN }}
- name: 🔑 Login to GHCR
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🪞 Mirror images to GHCR (best-effort)
shell: bash
env:
GHCR_NAMESPACE: ${{ steps.vars.outputs.ghcr_namespace }}
GHCR_REPOSITORY: ${{ steps.vars.outputs.ghcr_repository }}
GHCR_PREFIX: ${{ inputs.ghcr_prefix || 'mirror' }}
REPO_ROOT: ${{ inputs.repo_root || '.' }}
run: bash scripts/meta/mirror/sync/all.sh