Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

chore: add import image scripts #12

chore: add import image scripts

chore: add import image scripts #12

Workflow file for this run

name: Mirror images
permissions:
contents: write
pull-requests: read
actions: write
defaults:
run:
shell: bash
on:
push:
paths:
- "hack/mirror/mirror-images.txt"
workflow_dispatch: {}
jobs:
mirror-images:
timeout-minutes: 10
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
persist-credentials: false
- uses: imjasonh/[email protected]
with:
version: v0.16.1
- name: Mirror images
shell: bash
run: |
set -euo pipefail
# login to dockerhub
crane auth login docker.io -u ${{ secrets.CI_DOCKERHUB_USERNAME }} -p ${{ secrets.CI_DOCKERHUB_PASSWORD }}
# mirror images
while IFS= read -r line || [[ -n "$line" ]]; do
if [[ "$line" == \#* ]]; then
continue
fi
source_image=$(echo "$line" | awk '{print $1}')
target_image=$(echo "$line" | awk '{print $2}')
echo "Mirror image $source_image to $target_image"
crane copy $source_image $target_image
done < ${{ github.workspace }}/hack/mirror/mirror-images.txt