Merge pull request #5 from nuance-mix/fix/latest-tag
Fixing latest tag not having the JFrog artifactory URL
This commit is contained in:
commit
a47c8341f2
|
|
@ -8,7 +8,6 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_and_push_image:
|
build_and_push_image:
|
||||||
# runs-on: ubuntu-latest
|
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
|
|
@ -18,7 +17,8 @@ jobs:
|
||||||
name: Prepare
|
name: Prepare
|
||||||
id: prep
|
id: prep
|
||||||
run: |
|
run: |
|
||||||
DOCKER_IMAGE=xmix-docker-dev/grpcurl
|
REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}')
|
||||||
|
REGISTRY_PATH="${{ secrets.ARTIFACTORY_URL }}/xmix-docker-dev/${REPOSITORY_NAME}"
|
||||||
VERSION=edge
|
VERSION=edge
|
||||||
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||||
VERSION=${GITHUB_REF#refs/tags/}
|
VERSION=${GITHUB_REF#refs/tags/}
|
||||||
|
|
@ -27,14 +27,14 @@ jobs:
|
||||||
elif [[ $GITHUB_REF == refs/pull/* ]]; then
|
elif [[ $GITHUB_REF == refs/pull/* ]]; then
|
||||||
VERSION=pr-${{ github.event.number }}
|
VERSION=pr-${{ github.event.number }}
|
||||||
fi
|
fi
|
||||||
TAGS="${DOCKER_IMAGE}:${VERSION}"
|
TAGS="${REGISTRY_PATH}:${VERSION}"
|
||||||
# TODO: Refine... was creating too many hashes
|
# TODO: Refine... was creating too many hashes
|
||||||
# if [ "${{ github.event_name }}" = "push" ]; then
|
# if [ "${{ github.event_name }}" = "push" ]; then
|
||||||
# TAGS="$TAGS,${DOCKER_IMAGE}:sha-${GITHUB_SHA::8}"
|
# TAGS="$TAGS,${DOCKER_IMAGE}:sha-${GITHUB_SHA::8}"
|
||||||
# fi
|
# fi
|
||||||
# if we pushed a tag, we also want publish a new latest image
|
# if we pushed a tag, we also want publish a new latest image
|
||||||
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||||
TAGS="$TAGS,${DOCKER_IMAGE}:latest"
|
TAGS="$TAGS,${REGISTRY_PATH}:latest"
|
||||||
fi
|
fi
|
||||||
echo "TAGS to build and push are ${TAGS}"
|
echo "TAGS to build and push are ${TAGS}"
|
||||||
echo ::set-output name=version::${VERSION}
|
echo ::set-output name=version::${VERSION}
|
||||||
|
|
@ -59,7 +59,7 @@ jobs:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: "${{ secrets.ARTIFACTORY_URL }}/${{ steps.prep.outputs.tags }}"
|
tags: ${{ steps.prep.outputs.tags }}
|
||||||
labels: |
|
labels: |
|
||||||
org.opencontainers.image.source=${{ github.event.repository.html_url }}
|
org.opencontainers.image.source=${{ github.event.repository.html_url }}
|
||||||
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
|
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue