2025-07-06 21:15:49 +01:00
|
|
|
name: Mirror Container Images
|
|
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
schedule:
|
2026-04-14 22:26:23 +02:00
|
|
|
# Run nightly
|
|
|
|
|
- cron: "25 2 * * *"
|
|
|
|
|
|
|
|
|
|
workflow_call:
|
|
|
|
|
|
2025-07-06 21:15:49 +01:00
|
|
|
workflow_dispatch:
|
|
|
|
|
inputs:
|
|
|
|
|
dry_run:
|
|
|
|
|
description: 'Dry run (check only, no actual mirroring)'
|
|
|
|
|
required: false
|
|
|
|
|
default: false
|
|
|
|
|
type: boolean
|
2025-11-08 22:43:54 +00:00
|
|
|
push:
|
|
|
|
|
branches:
|
|
|
|
|
- main
|
|
|
|
|
paths:
|
|
|
|
|
# Re-run when config changes
|
|
|
|
|
- '.forgejo/regsync/regsync.yml'
|
|
|
|
|
- '.forgejo/workflows/mirror-images.yml'
|
2025-07-06 21:15:49 +01:00
|
|
|
concurrency:
|
|
|
|
|
group: "mirror-images"
|
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
mirror-images:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
env:
|
2025-07-06 22:57:33 +01:00
|
|
|
BUILTIN_REGISTRY_USER: ${{ vars.BUILTIN_REGISTRY_USER }}
|
2025-07-06 21:15:49 +01:00
|
|
|
BUILTIN_REGISTRY_PASSWORD: ${{ secrets.BUILTIN_REGISTRY_PASSWORD }}
|
2025-07-06 22:57:33 +01:00
|
|
|
GITLAB_USERNAME: ${{ vars.GITLAB_USERNAME }}
|
2025-07-06 21:15:49 +01:00
|
|
|
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
|
2025-11-08 22:56:16 +00:00
|
|
|
N7574_GIT_USERNAME: ${{ vars.N7574_GIT_USERNAME }}
|
|
|
|
|
N7574_GIT_TOKEN: ${{ secrets.N7574_GIT_TOKEN }}
|
2025-11-08 22:29:56 +00:00
|
|
|
GH_PACKAGES_USER: ${{ vars.GH_PACKAGES_USER }}
|
|
|
|
|
GH_PACKAGES_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}
|
2025-11-10 23:32:58 +00:00
|
|
|
DOCKER_MIRROR_USER: ${{ vars.DOCKER_MIRROR_USER }}
|
|
|
|
|
DOCKER_MIRROR_TOKEN: ${{ secrets.DOCKER_MIRROR_TOKEN }}
|
2025-07-06 21:15:49 +01:00
|
|
|
steps:
|
|
|
|
|
- name: Checkout repository
|
2026-04-13 05:22:53 +00:00
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
2025-07-06 21:15:49 +01:00
|
|
|
with:
|
|
|
|
|
persist-credentials: false
|
|
|
|
|
|
2025-11-08 22:29:56 +00:00
|
|
|
# - uses: https://github.com/actions/create-github-app-token@v2
|
|
|
|
|
# id: app-token
|
|
|
|
|
# with:
|
|
|
|
|
# app-id: ${{ vars.GH_APP_ID }}
|
|
|
|
|
# private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
|
|
|
|
|
# github-api-url: https://api.github.com
|
|
|
|
|
# owner: continuwuity
|
|
|
|
|
# repositories: continuwuity
|
2025-11-08 21:07:41 +00:00
|
|
|
|
2026-04-12 15:16:24 +01:00
|
|
|
- name: Install regsync
|
2026-04-15 05:03:06 +00:00
|
|
|
uses: https://github.com/regclient/actions/regsync-installer@f3c6d87835906c175eb6ccfc18b348b69bb447e7 # main
|
2025-07-06 21:15:49 +01:00
|
|
|
|
|
|
|
|
- name: Check what images need mirroring
|
|
|
|
|
run: |
|
|
|
|
|
echo "Checking images that need mirroring..."
|
|
|
|
|
regsync check -c .forgejo/regsync/regsync.yml -v info
|
|
|
|
|
|
|
|
|
|
- name: Mirror images
|
|
|
|
|
if: ${{ !inputs.dry_run }}
|
|
|
|
|
run: |
|
|
|
|
|
echo "Starting image mirroring..."
|
|
|
|
|
regsync once -c .forgejo/regsync/regsync.yml -v info
|