From 39833246b519483343bdf6136f3a57f60d9797b6 Mon Sep 17 00:00:00 2001 From: MarkAckert Date: Fri, 12 Jan 2024 15:28:52 -0500 Subject: [PATCH] use variable for docker registry Signed-off-by: MarkAckert --- .github/workflows/create-dockerfiles.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/create-dockerfiles.yml b/.github/workflows/create-dockerfiles.yml index 019772d..4988f64 100644 --- a/.github/workflows/create-dockerfiles.yml +++ b/.github/workflows/create-dockerfiles.yml @@ -17,6 +17,7 @@ on: default: 'latest' env: PUBLISH_RELEASE: ${{ github.event.inputs.publish_release }} + TARGET_DOCKER_REGISTRY: "" jobs: @@ -24,6 +25,14 @@ jobs: runs-on: ubuntu-latest steps: + - name: Set target docker registry + run: | + if [ "$PUBLISH_RELEASE" = true ]; then + echo "TARGET_DOCKER_REGISTRY=zowe-docker-release.jfrog.io" >> $GITHUB_ENV + else + echo "TARGET_DOCKER_REGISTRY=zowe-docker-snapshot.jfrog.io" >> $GITHUB_ENV + fi + - name: Checkout uses: actions/checkout@v2 @@ -33,26 +42,17 @@ jobs: - name: Login to JFrog uses: docker/login-action@v1 with: - registry: zowe-docker-snapshot.jfrog.io + registry: ${{ env.TARGET_DOCKER_REGISTRY }} username: ${{ secrets.ARTIFACTORY_USERNAME }} password: ${{ secrets.ARTIFACTORY_PASSWORD }} - - name: Build and push to snapshot - if: ${{ env.PUBLISH_RELEASE == 'false' }} - id: docker_build_snapshot - uses: docker/build-push-action@v2 - with: - push: true - file: licenses/docker/ort.Dockerfile - tags: zowe-docker-snapshot.jfrog.io/ompzowe/zowecicd-license-base:${{ github.event.inputs.image_version }} - - name: Build and push to release if: ${{ env.PUBLISH_RELEASE == 'true' }} - id: docker_build_release + id: docker_build uses: docker/build-push-action@v2 with: push: true file: licenses/docker/ort.Dockerfile - tags: zowe-docker-release.jfrog.io/ompzowe/zowecicd-license-base:${{ github.event.inputs.image_version }} + tags: ${{ env.TARGET_DOCKER_REGISTRY }}/ompzowe/zowecicd-license-base:${{ github.event.inputs.image_version }} \ No newline at end of file