Skip to content

Commit f267e08

Browse files
committed
feat: make -vanilla suffix optional in copy workflow
1 parent bc270cb commit f267e08

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

.github/workflows/copy.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow copies a Docker image from a source registry to Docker Hub.
22
# It uses the `skopeo` tool to perform the copy operation.
33
# The source image is specified in the format "namespace/name:tag".
4-
# The destination image is automatically suffixed with "-vanilla".
4+
# The destination image is optionally suffixed with "-vanilla" (enabled by default).
55
# The workflow is triggered manually via the GitHub Actions UI.
66

77
name: copy
@@ -36,9 +36,14 @@ on:
3636
required: false
3737
type: string
3838
dst-image-tag:
39-
description: 'Destination Docker image tag, inform of "{backend}{backend_version_vX_Y_Z}[{backend_version_extra}][-{backend_variant}]-python${python_version_vX_Y}", automatically suffixed with "-vanilla".'
39+
description: 'Destination Docker image tag, inform of "{backend}{backend_version_vX_Y_Z}[{backend_version_extra}][-{backend_variant}]-python${python_version_vX_Y}", optionally suffixed with "-vanilla".'
4040
required: true
4141
type: string
42+
vanilla-suffix:
43+
description: 'Append "-vanilla" suffix to the destination image tag.'
44+
required: false
45+
default: true
46+
type: boolean
4247

4348
env:
4449
INPUT_USERNAME: gpustack
@@ -63,6 +68,7 @@ jobs:
6368
INPUT_SRC_USERNAME: ${{ inputs.src-username }}
6469
INPUT_SRC_TOKEN: ${{ inputs.src-token }}
6570
INPUT_TAG: ${{ inputs.dst-image-tag }}
71+
INPUT_VANILLA_SUFFIX: ${{ inputs.vanilla-suffix }}
6672
run: |
6773
#!/usr/bin/env bash
6874
@@ -71,4 +77,9 @@ jobs:
7177
fi
7278
skopeo login docker.io -u ${INPUT_USERNAME} -p ${INPUT_PASSWORD}
7379
74-
skopeo copy docker://${INPUT_SRC_REGISTRY}/${INPUT_SRC_IMAGE} docker://docker.io/${INPUT_NAMESPACE}/${INPUT_REPOSITORY}:${INPUT_TAG}-vanilla --all --retry-delay 5s --retry-times 10
80+
DST_TAG="${INPUT_TAG}"
81+
if [[ "${INPUT_VANILLA_SUFFIX}" == "true" ]]; then
82+
DST_TAG="${DST_TAG}-vanilla"
83+
fi
84+
85+
skopeo copy docker://${INPUT_SRC_REGISTRY}/${INPUT_SRC_IMAGE} docker://docker.io/${INPUT_NAMESPACE}/${INPUT_REPOSITORY}:${DST_TAG} --all --retry-delay 5s --retry-times 10

0 commit comments

Comments
 (0)