Skip to content

Commit

Permalink
[release] Publish latest tag when making a release (#943)
Browse files Browse the repository at this point in the history
  • Loading branch information
barroco authored Feb 8, 2023
1 parent b67f730 commit 8bf1f3c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/dss-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ jobs:
- name: Build and push image
env:
DOCKER_URL: ${{ secrets.DOCKER_URL }}
DOCKER_UPDATE_LATEST: true
run: |
build/build.sh
16 changes: 16 additions & 0 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# directory. If run without a DOCKER_URL environment variable, it will just
# build images named interuss-local/*. If DOCKER_URL is present, it will both
# build the versioned dss image and push it to the DOCKER_URL remote.
# If DOCKER_URL is set, DOCKER_UPDATE_LATEST can be optionally set to `true` in order
# to publish the latest tag along the version.

set -eo pipefail

Expand All @@ -17,6 +19,7 @@ fi
cd "${BASEDIR}"

VERSION=$(./scripts/git/version.sh dss)
LATEST_TAG="latest"

if [[ -z "${DOCKER_URL}" ]]; then
echo "DOCKER_URL environment variable is not set; building image to interuss-local/dss..."
Expand All @@ -35,5 +38,18 @@ else

echo "Built and pushed docker image ${DOCKER_URL}/dss:${VERSION}"

if [[ "${DOCKER_UPDATE_LATEST}" == "true" ]]; then

echo "Tagging docker image ${DOCKER_URL}/dss:${LATEST_TAG}..."
docker tag "${DOCKER_URL}/dss:${VERSION}" "${DOCKER_URL}/dss:${LATEST_TAG}"

echo "Pushing docker image ${DOCKER_URL}/dss:${LATEST_TAG}..."

docker image push "${DOCKER_URL}/dss:${LATEST_TAG}"

echo "Built and pushed docker image ${DOCKER_URL}/dss:${LATEST_TAG}"

fi

echo "VAR_DOCKER_IMAGE_NAME: ${DOCKER_URL}/dss:${VERSION}"
fi

0 comments on commit 8bf1f3c

Please sign in to comment.