-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaction.yml
87 lines (74 loc) · 2.24 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# https://help.github.com/en/articles/metadata-syntax-for-github-actions
name: 'DockerHub mirror'
description: 'GitHub Action to mirror a DockerHub repo to another registry'
author: 'arvatoaws-labs'
branding:
color: 'green'
icon: 'copy'
inputs:
src-username:
description: 'Source username'
required: true
src-password:
description: 'Source password'
required: true
src-registry:
description: 'Source registry (eg. docker.io)'
required: true
default: docker.io
src-repo:
description: 'Source repo (eg. library/busybox)'
required: true
dst-username:
description: 'Destination username'
required: true
dst-password:
description: 'Destination password'
required: true
dst-registry:
description: 'Destination registry (eg. ghcr.io)'
required: true
default: ghcr.io
dst-repo:
description: 'Destination repo (eg. myrepo/busybox)'
required: true
config:
description: 'configfile to use'
required: true
default: config/generic.yaml
loglevel:
description: 'loglevel to use (debug, info, warn, error, fatal, panic)'
required: true
default: info
runs:
using: 'composite'
steps:
- run: |
set -e
export SRC_USER=${{ inputs.src-username }}
export SRC_PASS=${{ inputs.src-password }}
export SRC_REGISTRY=${{ inputs.src-registry }}
export SRC_REPO=${{ inputs.src-repo }}
export DST_USER=${{ inputs.dst-username }}
export DST_PASS=${{ inputs.dst-password }}
export DST_REPO=${{ inputs.dst-repo }}
export DST_REGISTRY=${{ inputs.dst-registry }}
export CONFIG=${{ inputs.config }}
export LOGLEVEL=${{ inputs.loglevel }}
wget -q https://github.com/regclient/regclient/releases/download/v0.6.1/regsync-linux-arm64 && chmod 755 regsync-linux-arm64
echo "::group::Version"
uname -a
cat /etc/os-release
lscpu
./regsync-linux-arm64 version
echo "::endgroup"
echo "::group::Config"
cat $CONFIG
echo "::endgroup"
echo "::group::Checking"
./regsync-linux-arm64 -c $CONFIG -v $LOGLEVEL check
echo "::endgroup"
echo "::group::Syncing"
./regsync-linux-arm64 -c $CONFIG -v $LOGLEVEL once
echo "::endgroup"
shell: bash