All checks were successful
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 6s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m0s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m3s
Checks / Prek / Check changed files (pull_request) Successful in 5s
Update flake hashes / update-flake-hashes (pull_request) Successful in 1m9s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been skipped
69 lines
2.1 KiB
YAML
69 lines
2.1 KiB
YAML
name: Mirror Container Images
|
|
|
|
on:
|
|
schedule:
|
|
# Run nightly
|
|
- cron: "25 2 * * *"
|
|
|
|
workflow_call:
|
|
|
|
workflow_dispatch:
|
|
inputs:
|
|
dry_run:
|
|
description: 'Dry run (check only, no actual mirroring)'
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
# Re-run when config changes
|
|
- '.forgejo/regsync/regsync.yml'
|
|
- '.forgejo/workflows/mirror-images.yml'
|
|
concurrency:
|
|
group: "mirror-images"
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
mirror-images:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
BUILTIN_REGISTRY_USER: ${{ vars.BUILTIN_REGISTRY_USER }}
|
|
BUILTIN_REGISTRY_PASSWORD: ${{ secrets.BUILTIN_REGISTRY_PASSWORD }}
|
|
GITLAB_USERNAME: ${{ vars.GITLAB_USERNAME }}
|
|
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
|
|
N7574_GIT_USERNAME: ${{ vars.N7574_GIT_USERNAME }}
|
|
N7574_GIT_TOKEN: ${{ secrets.N7574_GIT_TOKEN }}
|
|
GH_PACKAGES_USER: ${{ vars.GH_PACKAGES_USER }}
|
|
GH_PACKAGES_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}
|
|
DOCKER_MIRROR_USER: ${{ vars.DOCKER_MIRROR_USER }}
|
|
DOCKER_MIRROR_TOKEN: ${{ secrets.DOCKER_MIRROR_TOKEN }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
|
|
with:
|
|
persist-credentials: false
|
|
|
|
# - 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
|
|
|
|
- name: Install regsync
|
|
uses: https://github.com/regclient/actions/regsync-installer@14f9d37db17b5dc41fefd1ffdd1af4b9e2490560 # main
|
|
|
|
- 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
|