Skip to content

Commit

Permalink
fix tag extratction from github context
Browse files Browse the repository at this point in the history
  • Loading branch information
Hroman9n committed Dec 15, 2023
1 parent 70465ae commit b0cb473
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ jobs:
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- name: Get current tag
id: get-tag
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Build image
run: |
docker build -t "hroman9n/go-web-server:${{ github.ref }}" .
docker build -t "hroman9n/go-web-server:${{ steps.get-tag.outputs.tag }}" .
- name: Publish image to Dockerhub
shell: bash
env:
DOCKERHUB_LOGIN: ${{ secrets.DOCKERHUB_LOGIN }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
run: |
docker login -u "${DOCKERHUB_LOGIN}" -p "${DOCKERHUB_TOKEN}" && \
docker push hroman9n/go-web-server:${{ github.ref }}
docker push hroman9n/go-web-server:${{ steps.get-tag.outputs.tag }}

0 comments on commit b0cb473

Please sign in to comment.