Skip to content

Commit

Permalink
Adjust image name resolution to not omit dockersamples as a prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesir87 committed Jan 10, 2025
1 parent 32f0ec2 commit fd8af5c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/load-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ runs:
# place repo name and owner into ENV for the image name
echo "REPOSITORY_NAME=${{ github.event.repository.name }}" >> $GITHUB_ENV
echo "REPOSITORY_OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV
# Don't set a prefix if this is the authoritative repository (dockersamples)
if [ "${REPOSITORY_NAME}" == "dockersamples" ]; then
echo "IMAGE_PREFIX=" >> $GITHUB_ENV
else
echo "IMAGE_PREFIX=${REPOSITORY_NAME}-" >> $GITHUB_ENV
fi
if [ -f "${{ inputs.env-file-path }}" ]; then
# Export variables from .env
source "${{ inputs.env-file-path }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pipeline-docker-cloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKERHUB_NAMESPACE }}/${{ env.REPOSITORY_OWNER }}-${{ env.IMAGE_NAME_SUFFIX }}
images: ${{ env.DOCKERHUB_NAMESPACE }}/${{ env.IMAGE_PREFIX }}${{ env.IMAGE_NAME }}
tags: |
type=ref,enable=true,event=branch,suffix=--{{sha}}
type=ref,enable=true,event=branch,suffix=--latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pipeline-gha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKERHUB_NAMESPACE }}/${{ env.REPOSITORY_OWNER }}-${{ env.IMAGE_NAME_SUFFIX }}-gha
images: ${{ env.DOCKERHUB_NAMESPACE }}/${{ env.IMAGE_PREFIX }}${{ env.IMAGE_NAME }}-gha
tags: |
type=ref,enable=true,event=branch,suffix=--{{sha}}
type=ref,enable=true,event=branch,suffix=--latest
Expand Down
2 changes: 1 addition & 1 deletion gha.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
DOCKERHUB_NAMESPACE=dockerdevrel
IMAGE_NAME_SUFFIX=catalog-service-node
IMAGE_NAME=catalog-service-node
DBC_BUILDER_NAME=dockerdevrel/demo-builder
# You will also need the following secrets in the repository:
# DOCKERHUB_USERNAME
Expand Down

0 comments on commit fd8af5c

Please sign in to comment.