From 087abcb570bff48d0e0d10c6c6d3d544c0539f12 Mon Sep 17 00:00:00 2001 From: "Mahadik, Mukul Chandrakant" Date: Fri, 26 Apr 2024 01:54:21 -0700 Subject: [PATCH] Workflow dispatch receive - 1 Added working code for workflow dispatch receive from join repo. --- .github/workflows/image_build_push.yml | 38 ++++++++++++++++---------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/.github/workflows/image_build_push.yml b/.github/workflows/image_build_push.yml index 7a5e5e84..2b2f1e9e 100644 --- a/.github/workflows/image_build_push.yml +++ b/.github/workflows/image_build_push.yml @@ -6,11 +6,17 @@ name: docker-image-push-public-dash # events but only for the master branch on: push: - # Mukul: - # I've added a local test branch on my system and using it for testing image push. - # So, for testing purposes, need to checkout a branch "image-push-merge" - # TODO: Need to change to build off master or main once it looks good. - branches: [ image-push-merge ] + # Mukul: + # I've added a local test branch on my system and using it for testing image push. + # So, for testing purposes, need to checkout a branch "tags-dispatch" + # TODO: Need to change to build off master or main once it looks good. + branches: [ tags-dispatch ] + + workflow_dispatch: + inputs: + docker_image_tag: + description: "Latest Docker image tags passed from e-mission-server repository on image build and push" + required: true # Env variable @@ -24,7 +30,7 @@ jobs: build: # The type of runner that the job will run on runs-on: ubuntu-latest - + # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it @@ -42,13 +48,17 @@ jobs: run: echo running in repo ${GITHUB_REPOSITORY#*/} branch ${GITHUB_REF##*/} on ${{ steps.date.outputs.date }} # Runs a set of commands using the runners shell - - name: build docker image - run: | - docker build -t $DOCKER_USER/${GITHUB_REPOSITORY#*/}:${GITHUB_REF##*/}_${{ steps.date.outputs.date }} ./frontend - docker build -t $DOCKER_USER/${GITHUB_REPOSITORY#*/}_notebook:${GITHUB_REF##*/}_${{ steps.date.outputs.date }} ./viz_scripts - docker images + # - name: build docker image + # run: | + # docker build -t $DOCKER_USER/${GITHUB_REPOSITORY#*/}:${GITHUB_REF##*/}_${{ steps.date.outputs.date }} ./frontend + # docker build -t $DOCKER_USER/${GITHUB_REPOSITORY#*/}_notebook:${GITHUB_REF##*/}_${{ steps.date.outputs.date }} ./viz_scripts + # docker images + + # - name: push docker image + # run: | + # docker push $DOCKER_USER/${GITHUB_REPOSITORY#*/}:${GITHUB_REF##*/}_${{ steps.date.outputs.date }} + # docker push $DOCKER_USER/${GITHUB_REPOSITORY#*/}_notebook:${GITHUB_REF##*/}_${{ steps.date.outputs.date }} - - name: push docker image + - name: Print input docker image tag run: | - docker push $DOCKER_USER/${GITHUB_REPOSITORY#*/}:${GITHUB_REF##*/}_${{ steps.date.outputs.date }} - docker push $DOCKER_USER/${GITHUB_REPOSITORY#*/}_notebook:${GITHUB_REF##*/}_${{ steps.date.outputs.date }} + echo "Input latest docker image tag: ${{ github.event.inputs.docker_image_tag }}"