From b6be6f05856f474cfae2db2793983358ecf02174 Mon Sep 17 00:00:00 2001 From: Lea Vauchier Date: Mon, 29 Apr 2024 17:06:08 +0200 Subject: [PATCH] Tag docker image with current version (for later github action ease of use) --- .github/workflows/cicd.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index ae84c3d6..18cdf09e 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -96,10 +96,14 @@ jobs: - name: push main docker on nexus (tagged with a date) # we push on nexus an image from the main branch when it has been updated (push or accepted pull request) + # The version is tagged once with version only to make sure to be able to retrieve the last version without + # knowing when it has been published, once with version + date to ensure a unique tag when needed if: ((github.ref_name == 'main') && (github.event_name == 'push')) run: | + docker tag lidar_prod $nexus_server/lidar_hd/lidar_prod:${{ env.VERSION }} docker tag lidar_prod $nexus_server/lidar_hd/lidar_prod:${{ env.VERSION }}-${{ env.DATE }} docker login $nexus_server --username svc_lidarhd --password ${{ secrets.PASSWORD_SVC_LIDARHD }} + docker push $nexus_server/lidar_hd/lidar_prod:${{ env.VERSION }} docker push $nexus_server/lidar_hd/lidar_prod:${{ env.VERSION }}-${{ env.DATE }} - name: push branch docker on nexus (tagged with the branch name)