Skip to content

Commit

Permalink
fix: tag name for focker publish issue
Browse files Browse the repository at this point in the history
  • Loading branch information
doncicuto committed Sep 15, 2022
1 parent 9f947ee commit 780c310
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/docker_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/glim:${{steps.set_version.outputs.no-dash}} , ${{ secrets.DOCKER_HUB_USERNAME }}/myapp:latest

0 comments on commit 780c310

Please sign in to comment.