From d4968c4c39cc8e8399fb18048027579149a840c5 Mon Sep 17 00:00:00 2001 From: Lea Vauchier Date: Thu, 2 May 2024 11:16:39 +0200 Subject: [PATCH] Add version only tag to the docker image pushed by cicd --- .github/workflows/cicd.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index 0405f050..93611a83 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -100,10 +100,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 myria3d ${{ secrets.DOCKER_REGISTRY }}/lidar_hd/myria3d:${{ env.VERSION }} docker tag myria3d ${{ secrets.DOCKER_REGISTRY }}/lidar_hd/myria3d:${{ env.VERSION }}-${{ env.DATE }} docker login ${{ secrets.DOCKER_REGISTRY }} --username svc_lidarhd --password ${{ secrets.PASSWORD_SVC_LIDARHD }} + docker push ${{ secrets.DOCKER_REGISTRY }}/lidar_hd/myria3d:${{ env.VERSION }} docker push ${{ secrets.DOCKER_REGISTRY }}/lidar_hd/myria3d:${{ env.VERSION }}-${{ env.DATE }} - name: push branch docker on nexus (tagged with the branch name)