-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathaction.yml
39 lines (38 loc) · 1.59 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
name: 'skopeo-copy-action'
description: 'Copy image from src to dst by Skopeo'
author: [email protected]
branding:
color: blue
icon: copy
inputs:
src-image:
description: "source image with tag to copy from"
required: true
src-creds:
description: "credentials with format: [USERNAME]:[PASSWORD] to pull source image"
required: true
dst-image:
description: "destination image with tag to copy to"
required: true
dst-creds:
description: "credentials with format: [USERNAME]:[PASSWORD] to push destination image"
required: true
runs:
using: "composite"
steps:
- name: copy with src-creds only
if: ${{ inputs.src-creds != '' && inputs.dst-creds == '' }}
run: skopeo copy --all --src-creds ${{ inputs.src-creds }} docker://${{ inputs.src-image }} docker://${{ inputs.dst-image }}
shell: bash
- name: copy with dst-creds only
if: ${{ inputs.src-creds == '' && inputs.dst-creds != '' }}
run: skopeo copy --all --dest-creds ${{ inputs.dst-creds }} docker://${{ inputs.src-image }} docker://${{ inputs.dst-image }}
shell: bash
- name: copy with src-creds and dst-creds
if: ${{ inputs.src-creds != '' && inputs.dst-creds != '' }}
run: skopeo copy --all --src-creds ${{ inputs.src-creds }} --dest-creds ${{ inputs.dst-creds }} docker://${{ inputs.src-image }} docker://${{ inputs.dst-image }}
shell: bash
- name: copy without credentials
if: ${{ inputs.src-creds == '' && inputs.dst-creds == '' }}
run: skopeo copy --all docker://${{ inputs.src-image }} docker://${{ inputs.dst-image }}
shell: bash