diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4a2e31ebfe..9c84a59e41 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,6 +19,10 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_AUTH_TOKEN }} + # The expression strips off the shortest match from the front of the string to yield just the tag name as the output + - name: Get tagged version + run: echo "GITHUB_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: Build and Push image run: make docker-build && make docker-push diff --git a/Makefile b/Makefile index a68d774cf9..09ba576d38 100644 --- a/Makefile +++ b/Makefile @@ -20,12 +20,12 @@ clean: API_DEFINITIONS_SHA=$(shell git log --oneline | grep Regenerated | head -n1 | cut -d ' ' -f 5) docker-build: docker build -t twilio/twilio-node . - docker tag twilio/twilio-node twilio/twilio-node:${TRAVIS_TAG} + docker tag twilio/twilio-node twilio/twilio-node:${GITHUB_TAG} docker tag twilio/twilio-node twilio/twilio-node:apidefs-${API_DEFINITIONS_SHA} docker tag twilio/twilio-node twilio/twilio-node:latest docker-push: echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin - docker push twilio/twilio-node:${TRAVIS_TAG} + docker push twilio/twilio-node:${GITHUB_TAG} docker push twilio/twilio-node:apidefs-${API_DEFINITIONS_SHA} docker push twilio/twilio-node:latest