Skip to content

Commit 9825c34

Browse files
committed
Set registry to be used
1 parent 2ba50ed commit 9825c34

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/builds.yml

+11-2
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,21 @@ jobs:
122122
gcloud auth configure-docker
123123
fi
124124
125+
- name: Set CONTAINER_REGISTRY
126+
id: set-registry
127+
run: |
128+
if [[ "${{ github.event.inputs.private_build }}" == "true" ]]; then
129+
echo "CONTAINER_REGISTRY=${{ vars.PRIVATE_REGISTRY }}" >> $GITHUB_ENV
130+
else
131+
echo "CONTAINER_REGISTRY=${{ vars.PUBLIC_REGISTRY }}" >> $GITHUB_ENV
132+
fi
133+
125134
- name: Build/Push ${{ matrix.role }} amd64 images with adx (default)
126135
env:
127136
IMAGE_TAG: ${{ inputs.docker_tag }}
128137
CADENCE_DEPLOY_KEY: ${{ secrets.CADENCE_DEPLOY_KEY }}
129138
run: |
130-
make docker-build-${{ matrix.role }}-with-adx docker-push-${{ matrix.role }}-with-adx CONTAINER_REGISTRY=${{ github.event.inputs.private_build == "true" && vars.PRIVATE_REGISTRY || vars.PUBLIC_REGISTRY }}
139+
make docker-build-${{ matrix.role }}-with-adx docker-push-${{ matrix.role }}-with-adx CONTAINER_REGISTRY=$CONTAINER_REGISTRY
131140
132141
- name: Build/Push ${{ matrix.role }} amd64 images without netgo and without adx, arm64 images
133142
if: ${{ inputs.include_alternative_builds }}
@@ -137,7 +146,7 @@ jobs:
137146
run: |
138147
make docker-build-${{ matrix.role }}-without-adx docker-push-${{ matrix.role }}-without-adx \
139148
docker-build-${{ matrix.role }}-without-netgo-without-adx docker-push-${{ matrix.role }}-without-netgo-without-adx \
140-
docker-cross-build-${{ matrix.role }}-arm docker-push-${{ matrix.role }}-arm CONTAINER_REGISTRY=${{ github.event.inputs.private_build == "true" && vars.PRIVATE_REGISTRY || vars.PUBLIC_REGISTRY }}
149+
docker-cross-build-${{ matrix.role }}-arm docker-push-${{ matrix.role }}-arm CONTAINER_REGISTRY=$CONTAINER_REGISTRY
141150
142151
143152

0 commit comments

Comments
 (0)