File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 1414 run : |
1515 git config --local user.name "${GITHUB_ACTOR}"
1616 git config --local user.email "${GITHUB_ACTOR}@users.noreply.github.com"
17- - name : Set up env vars
18- run : echo "CURRENT_GIT_REF='$(echo ${GITHUB_REF} | awk 'BEGIN { FS = "/" } ; { print $3 }')'" >> "${GITHUB_ENV}" # Pass the tag, or target branch for a PR, or the branch
1917 - name : Build
2018 run : |
2119 make build
Original file line number Diff line number Diff line change 22DOCKER_IMAGE_NAME ?= docker-asciidoctor
33DOCKERHUB_USERNAME ?= asciidoctor
44export DOCKER_BUILDKIT =1
5- CURRENT_GIT_REF ?= $(shell git rev-parse --abbrev-ref HEAD) # Default to current branch
6- DOCKER_IMAGE_TAG ?= $(shell echo $(CURRENT_GIT_REF ) | sed 's/\//-/' )
5+ GIT_TAG = $(shell git describe --exact-match --tags HEAD 2>/dev/null)
6+ ifeq ($(strip $(GIT_TAG ) ) ,)
7+ GIT_REF = $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
8+ else
9+ GIT_REF = $(GIT_TAG )
10+ endif
11+ DOCKER_IMAGE_TAG ?= $(shell echo $(GIT_REF ) | sed 's/\//-/' )
712DOCKER_IMAGE_NAME_TO_TEST ?= $(DOCKERHUB_USERNAME ) /$(DOCKER_IMAGE_NAME ) :$(DOCKER_IMAGE_TAG )
813ASCIIDOCTOR_VERSION ?= 2.0.12
914ASCIIDOCTOR_CONFLUENCE_VERSION ?= 0.0.2
@@ -45,7 +50,7 @@ deploy:
4550ifdef DOCKERHUB_SOURCE_TOKEN
4651ifdef DOCKERHUB_TRIGGER_TOKEN
4752 curl --verbose --header "Content-Type: application/json" \
48- --data '{"source_type": "$(shell [ -n "${TRAVIS_TAG} " ] && echo Tag || echo Branch)", "source_name": "$(CURRENT_GIT_REF )"}' \
53+ --data '{"source_type": "$(shell [ -n "$(GIT_TAG) " ] && echo Tag || echo Branch)", "source_name": "$(GIT_REF )"}' \
4954 -X POST https://hub.docker.com/api/build/v1/source/$(DOCKERHUB_SOURCE_TOKEN)/trigger/$(DOCKERHUB_TRIGGER_TOKEN)/call/
5055else
5156 @echo 'Unable to deploy: Please define $$DOCKERHUB_TRIGGER_TOKEN'
You can’t perform that action at this time.
0 commit comments