From 780c310461043c3d95460b961eac99f91d62f6ee Mon Sep 17 00:00:00 2001 From: Miguel Cabrerizo Date: Thu, 15 Sep 2022 05:43:36 +0200 Subject: [PATCH] fix: tag name for focker publish issue --- .github/workflows/docker_publish.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker_publish.yml b/.github/workflows/docker_publish.yml index 56061a4..4f02607 100644 --- a/.github/workflows/docker_publish.yml +++ b/.github/workflows/docker_publish.yml @@ -23,13 +23,17 @@ jobs: id: set_version with: script: | - const tag = github.ref_name + const tag = context.ref.substring(10) const no_v = tag.replace('v', '') - core.setOutput('no_v', no_v) + const dash_index = no_v.lastIndexOf('-') + const no_dash = (dash_index > -1) ? no_v.substring(0, dash_index) : no_v + core.setOutput('tag', tag) + core.setOutput('no-v', no_v) + core.setOutput('no-dash', no_dash) - name: Build and push Docker image uses: docker/build-push-action@v3 with: context: . push: true - tags: ${{ secrets.DOCKER_HUB_USERNAME }}/glim:${{ steps.set_version.outputs.no_v }} , ${{ secrets.DOCKER_HUB_USERNAME }}/myapp:latest \ No newline at end of file + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/glim:${{steps.set_version.outputs.no-dash}} , ${{ secrets.DOCKER_HUB_USERNAME }}/myapp:latest \ No newline at end of file