Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #695 - Updated to support adding branch name to testing tags #697

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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