Skip to content

Commit

Permalink
Merge pull request #696 from bencourliss/master
Browse files Browse the repository at this point in the history
Issue #695 - Updated to support adding branch name to testing tags
  • Loading branch information
naphelps authored Aug 14, 2023
2 parents 366d107 + d933fd4 commit bf3e9f1
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ env:
IMAGE_REPO: ${{ vars.DOCKERHUB_REPO }}
GITHUB_CONTAINER_REGISTRY: ghcr.io/${{ github.repository_owner }}
BUILD_NUMBER: ${{ github.run_number }}
GH_BRANCH: ${{ github.ref_name }}

# Jobs that will run when the workflow is triggered
jobs:
Expand Down Expand Up @@ -106,9 +107,11 @@ jobs:
- name: Publish Image to Dockerhub
run: |
docker tag openhorizon/amd64_exchange-api:${IMAGE_VERSION} ${IMAGE_REPO}/amd64_exchange-api:testing
if [[ "$GITHUB_REF" == 'refs/heads/master' ]]; then \
docker push ${IMAGE_REPO}/amd64_exchange-api:testing; \
docker tag ${IMAGE_REPO}/amd64_exchange-api:testing ${GITHUB_CONTAINER_REGISTRY}/amd64_exchange-api:testing; \
docker push ${GITHUB_CONTAINER_REGISTRY}/amd64_exchange-api:testing; \
fi
if [[ "$GITHUB_REF" == 'refs/heads/master' ]]; then
docker push ${IMAGE_REPO}/amd64_exchange-api:testing
docker tag ${IMAGE_REPO}/amd64_exchange-api:testing ${GITHUB_CONTAINER_REGISTRY}/amd64_exchange-api:testing
docker push ${GITHUB_CONTAINER_REGISTRY}/amd64_exchange-api:testing
else
docker tag ${IMAGE_REPO}/amd64_exchange-api:testing ${IMAGE_REPO}/amd64_exchange-api:testing_${GH_BRANCH}
docker push ${IMAGE_REPO}/amd64_exchange-api:testing_${GH_BRANCH}
fi

0 comments on commit bf3e9f1

Please sign in to comment.