File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 38
38
- name : Authenticate if WITH_PUSH
39
39
run : |
40
40
if [[ "${WITH_PUSH}" == true ]]; then
41
- echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password-- stdin
41
+ echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password-stdin
42
42
fi
43
43
- name : Build Docker Image
44
44
run : |
57
57
- name : Authenticate if WITH_PUSH
58
58
run : |
59
59
if [[ "${WITH_PUSH}" == true ]]; then
60
- echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password-- stdin
60
+ echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password-stdin
61
61
fi
62
62
- name : Build Docker Image
63
63
run : |
70
70
- name : Authenticate if WITH_PUSH
71
71
run : |
72
72
if [[ "${WITH_PUSH}" == true ]]; then
73
- echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password-- stdin
73
+ echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password-stdin
74
74
fi
75
75
- name : Build Docker Image
76
76
run : |
Original file line number Diff line number Diff line change @@ -52,16 +52,30 @@ DOCKER_IMAGE=${DOCKER_REGISTRY}/pytorch/manylinux-builder:${DOCKER_TAG}
52
52
" ${TOPDIR} "
53
53
)
54
54
55
+ GITHUB_REF=${GITHUB_REF:- $(git symbolic-ref -q HEAD || git describe --tags --exact-match)}
56
+ GIT_BRANCH_NAME=${GITHUB_REF##*/ }
57
+ GIT_COMMIT_SHA=${GITHUB_SHA:- $(git rev-parse HEAD)}
58
+ DOCKER_IMAGE_BRANCH_TAG=${DOCKER_IMAGE} -${GIT_BRANCH_NAME}
59
+ DOCKER_IMAGE_SHA_TAG=${DOCKER_IMAGE} -${GIT_COMMIT_SHA}
60
+
55
61
(
56
62
set -x
57
63
docker tag ${DOCKER_IMAGE} ${LEGACY_DOCKER_IMAGE}
64
+ if [[ -n ${GITHUB_REF} ]]; then
65
+ docker tag ${DOCKER_IMAGE} ${DOCKER_IMAGE_BRANCH_TAG}
66
+ docker tag ${DOCKER_IMAGE} ${DOCKER_IMAGE_SHA_TAG}
67
+ fi
58
68
)
59
69
60
70
if [[ " ${WITH_PUSH} " == true ]]; then
61
71
(
62
72
set -x
63
73
docker push " ${DOCKER_IMAGE} "
64
74
docker push " ${LEGACY_DOCKER_IMAGE} "
75
+ if [[ -n ${GITHUB_REF} ]]; then
76
+ docker push " ${DOCKER_IMAGE_BRANCH_TAG} "
77
+ docker push " ${DOCKER_IMAGE_SHA_TAG} "
78
+ fi
65
79
)
66
80
fi
67
81
You can’t perform that action at this time.
0 commit comments