Skip to content

Commit 210d836

Browse files
authored
Merge pull request #207 from NREL/auto-update-latest-tag
ci: update deploy script to conditionally push 'latest' tag for stable releases only
2 parents bf3bacc + 0ce84ee commit 210d836

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

deploy_docker.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,15 @@ if [ "${IMAGETAG}" != "skip" ] && [[ -z "${GITHUB_BASE_REF}" ]]; then
3535
echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin
3636
# Tag versioned image
3737
docker tag openstudio:latest ${DOCKER_REPO}:$IMAGETAG; (( exit_status = exit_status || $? ))
38-
# Always update latest
39-
docker tag openstudio:latest ${DOCKER_REPO}:latest; (( exit_status = exit_status || $? ))
38+
39+
# Only update and push 'latest' if this is a stable release (no extension)
40+
if [ -z "${OPENSTUDIO_VERSION_EXT}" ]; then
41+
echo "Stable release detected. Updating and pushing '${DOCKER_REPO}:latest'"
42+
docker tag openstudio:latest ${DOCKER_REPO}:latest; (( exit_status = exit_status || $? ))
43+
docker push ${DOCKER_REPO}:latest; (( exit_status = exit_status || $? ))
44+
else
45+
echo "Pre-release detected (extension: '${OPENSTUDIO_VERSION_EXT}'). Skipping 'latest' tag update."
46+
fi
4047

4148
# Push versioned tag
4249
docker push ${DOCKER_REPO}:$IMAGETAG; (( exit_status = exit_status || $? ))

0 commit comments

Comments
 (0)