From 2975d487e4b4d4c81249cdf4c16c37467c79d882 Mon Sep 17 00:00:00 2001 From: Aaron Brethorst Date: Sat, 25 Jan 2025 14:06:30 -0800 Subject: [PATCH] Push up a `latest` tag to Docker Hub for each OBA image version E.g. you can use `2.5.13-otsf-latest` instead of having to hardcode the specific Docker image version. --- .github/workflows/docker.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 7bd2e6a..799c083 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -67,8 +67,12 @@ jobs: - name: onebusaway-api-webapp context: oba steps: - - name: Compute image tag name - run: echo "IMAGE_TAG=$(echo $GITHUB_REF_NAME)" >> $GITHUB_ENV + - name: Compute image tag names + run: | + # Set the full version tag (e.g., 2.5.13-otsf-v5.0.0) + echo "IMAGE_TAG=$(echo $GITHUB_REF_NAME)" >> $GITHUB_ENV + # Extract the software version (e.g., 2.5.13-otsf) and add -latest + echo "LATEST_TAG=$(echo $GITHUB_REF_NAME | sed 's/-v[0-9]\+\.[0-9]\+\.[0-9]\+/-latest/')" >> $GITHUB_ENV - name: Checkout code uses: actions/checkout@v4 - name: Set up QEMU @@ -98,3 +102,4 @@ jobs: push: true tags: | opentransitsoftwarefoundation/${{ matrix.name }}:${{ env.IMAGE_TAG }} + opentransitsoftwarefoundation/${{ matrix.name }}:${{ env.LATEST_TAG }}