Skip to content

Commit

Permalink
Changing event_name check from push to release
Browse files Browse the repository at this point in the history
  • Loading branch information
MukuFlash03 committed Oct 7, 2024
1 parent b5ee012 commit 211fe62
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/reusable_image_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ jobs:
- name: Set docker image tags
id: set-tags
run: |
ls -al
set -a; source .env; set +a
if [ "${{ inputs.repo }}" = "e-mission-server" ]; then
echo "SERVER_IMAGE_TAG=${SERVER_IMAGE_TAG}" >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -191,7 +190,7 @@ jobs:
docker build -t $DOCKER_USER/${{ inputs.repo }}:${{ steps.fetch-latest-release-tags.outputs.tag_name }} .
# docker build -t $DOCKER_USER/${{ inputs.repo }}:${{ inputs.branch }}_${{ steps.fetch-latest-release-tags.outputs.tag_name }} .
elif [ "${{ inputs.repo }}" = "nrel-openpath-join-page" ]; then
if [ "${{ github.event_name }}" == "push" ]; then
if [ "${{ github.event_name }}" == "release" ]; then
docker build -t $DOCKER_USER/${{ inputs.repo }}:${{ steps.fetch-latest-release-tags.outputs.tag_name }} ./frontend
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
docker build -t $DOCKER_USER/${{ inputs.repo }}:${{ steps.increment-release-tag.outputs.new_repo_version }} ./frontend
Expand All @@ -207,15 +206,15 @@ jobs:
if: ${{ github.ref_type == 'tag' || github.event_name == 'workflow_dispatch' }}
run: |
if [ "${{ inputs.repo }}" = "op-admin-dashboard" ]; then
if [ "${{ github.event_name }}" == "push" ]; then
if [ "${{ github.event_name }}" == "release" ]; then
docker image tag e-mission/opdash:0.0.1 $DOCKER_USER/${{ inputs.repo }}:${{ steps.fetch-latest-release-tags.outputs.tag_name }}
# docker image tag e-mission/opdash:0.0.1 $DOCKER_USER/${{ inputs.repo }}:${{ inputs.branch }}_${{ steps.fetch-latest-release-tags.outputs.tag_name }}
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
docker image tag e-mission/opdash:0.0.1 $DOCKER_USER/${{ inputs.repo }}:${{ steps.increment-release-tag.outputs.new_repo_version }}
# docker image tag e-mission/opdash:0.0.1 $DOCKER_USER/${{ inputs.repo }}:${{ inputs.branch }}_${{ steps.increment-release-tag.outputs.new_repo_version }}
fi
elif [ "${{ inputs.repo }}" = "em-public-dashboard" ]; then
if [ "${{ github.event_name }}" == "push" ]; then
if [ "${{ github.event_name }}" == "release" ]; then
docker image tag em-pub-dash-prod/frontend:latest $DOCKER_USER/${{ inputs.repo }}_frontend:${{ steps.fetch-latest-release-tags.outputs.tag_name }}
docker image tag em-pub-dash-prod/viz-scripts:latest $DOCKER_USER/${{ inputs.repo }}_notebook:${{ steps.fetch-latest-release-tags.outputs.tag_name }}
# docker image tag em-pub-dash-prod/frontend:latest $DOCKER_USER/${{ inputs.repo }}_frontend:${{ inputs.branch }}_${{ steps.fetch-latest-release-tags.outputs.tag_name }}
Expand All @@ -230,7 +229,7 @@ jobs:
if: ${{ github.ref_type == 'tag' || github.event_name == 'workflow_dispatch' }}
run: |
if [ "${{ inputs.repo }}" = "em-public-dashboard" ]; then
if [ "${{ github.event_name }}" == "push" ]; then
if [ "${{ github.event_name }}" == "release" ]; then
docker push $DOCKER_USER/${{ inputs.repo }}_frontend:${{ steps.fetch-latest-release-tags.outputs.tag_name }}
docker push $DOCKER_USER/${{ inputs.repo }}_notebook:${{ steps.fetch-latest-release-tags.outputs.tag_name }}
# docker push $DOCKER_USER/${{ inputs.repo }}_frontend:${{ inputs.branch }}_${{ steps.fetch-latest-release-tags.outputs.tag_name }}
Expand All @@ -240,7 +239,7 @@ jobs:
# docker push $DOCKER_USER/${{ inputs.repo }}_notebook:${{ inputs.branch }}_${{ steps.increment-release-tag.outputs.new_repo_version }}
fi
elif [ "${{ inputs.repo }}" = "op-admin-dashboard" ] || [ "${{ inputs.repo }}" = "nrel-openpath-join-page" ]; then
if [ "${{ github.event_name }}" == "push" ]; then
if [ "${{ github.event_name }}" == "release" ]; then
docker push $DOCKER_USER/${{ inputs.repo }}:${{ steps.fetch-latest-release-tags.outputs.tag_name }}
# docker push $DOCKER_USER/${{ inputs.repo }}:${{ inputs.branch }}_${{ steps.fetch-latest-release-tags.outputs.tag_name }}
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
Expand All @@ -259,15 +258,15 @@ jobs:
echo "SERVER_IMAGE_TAG=${{ steps.fetch-latest-release-tags.outputs.tag_name }}" > .env
# echo "SERVER_IMAGE_TAG=${{ inputs.branch }}_${{ steps.fetch-latest-release-tags.outputs.tag_name }}" > .env
elif [ "${{ inputs.repo }}" = "nrel-openpath-join-page" ]; then
if [ "${{ github.event_name }}" == "push" ]; then
if [ "${{ github.event_name }}" == "release" ]; then
echo "JOIN_IMAGE_TAG=${{ steps.fetch-latest-release-tags.outputs.tag_name }}" > .env
# echo "JOIN_IMAGE_TAG=${{ inputs.branch }}_${{ steps.fetch-latest-release-tags.outputs.tag_name }}" > .env
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "JOIN_IMAGE_TAG=${{ steps.increment-release-tag.outputs.new_repo_version }}" > .env
# echo "JOIN_IMAGE_TAG=${{ inputs.branch }}_${{ steps.increment-release-tag.outputs.new_repo_version }}" > .env
fi
elif [ "${{ inputs.repo }}" = "op-admin-dashboard" ]; then
if [ "${{ github.event_name }}" == "push" ]; then
if [ "${{ github.event_name }}" == "release" ]; then
echo "ADMIN_DASH_IMAGE_TAG=${{ steps.fetch-latest-release-tags.outputs.tag_name }}" > .env
# echo "ADMIN_DASH_IMAGE_TAG=${{ inputs.branch }}_${{ steps.fetch-latest-release-tags.outputs.tag_name }}" > .env
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
Expand All @@ -276,8 +275,8 @@ jobs:
fi
echo "SERVER_IMAGE_TAG=${{ steps.get-server-tag.outputs.SERVER_IMAGE_TAG }}" >> .env
elif [ "${{ inputs.repo }}" = "em-public-dashboard" ]; then
if [ "${{ github.event_name }}" == "push" ]; then
echo "Push event: Update frontend image tag"
if [ "${{ github.event_name }}" == "release" ]; then
echo "Release event: Update frontend image tag"
echo "PUBLIC_DASH_NOTEBOOK_IMAGE_TAG=${{ steps.fetch-latest-release-tags.outputs.tag_name }}" > .env
echo "PUBLIC_DASH_FRONTEND_IMAGE_TAG=${{ steps.fetch-latest-release-tags.outputs.tag_name }}" >> .env
# echo "PUBLIC_DASH_NOTEBOOK_IMAGE_TAG=${{ inputs.branch }}_${{ steps.fetch-latest-release-tags.outputs.tag_name }}" > .env
Expand Down

0 comments on commit 211fe62

Please sign in to comment.