Skip to content

Commit

Permalink
Workflow dispatch receive - 1
Browse files Browse the repository at this point in the history
Added working code for workflow dispatch receive from join repo.
  • Loading branch information
Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 26, 2024
1 parent f924af0 commit ec7df49
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions .github/workflows/image_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ 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"
# 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: [ image-push-merge ]
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
Expand All @@ -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
Expand All @@ -42,11 +48,15 @@ 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 }} .
docker images
# - name: build docker image
# run: |
# docker build -t $DOCKER_USER/${GITHUB_REPOSITORY#*/}:${GITHUB_REF##*/}_${{ steps.date.outputs.date }} .
# docker images

# - name: push docker image
# run: |
# docker push $DOCKER_USER/${GITHUB_REPOSITORY#*/}:${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 }}
echo "Input latest docker image tag: ${{ github.event.inputs.docker_image_tag }}"

0 comments on commit ec7df49

Please sign in to comment.