Skip to content

Commit

Permalink
Cleaned up code
Browse files Browse the repository at this point in the history
  • Loading branch information
MukuFlash03 committed Oct 8, 2024
1 parent 890d611 commit 88caacb
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/reusable_image_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ jobs:
# if: ${{ inputs.repo == 'op-admin-dashboard' || inputs.repo == 'em-public-dashboard' }}
if: ${{ inputs.repo == 'op-admin-dashboard' || inputs.repo == 'em-public-dashboard' || inputs.repo == 'nrel-openpath-join-page' }}
run: |
: << 'EOF'
response=$(curl -s https://raw.githubusercontent.com/MukuFlash03/e-mission-server/refs/heads/cleanup-cicd/.env)
SERVER_IMAGE_TAG=$(echo "$response" | grep "SERVER_IMAGE_TAG=" | cut -d'=' -f2)
echo "SERVER_IMAGE_TAG=$SERVER_IMAGE_TAG" >> "$GITHUB_OUTPUT"
EOF
response=$(curl -L -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_FG_PAT_TAGS }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
Expand Down Expand Up @@ -81,9 +75,6 @@ jobs:
current_server_tag_only=${current_server_tag:1}
previous_server_tag_only=${previous_server_tag:1}
echo "Current tag no v: $current_server_tag_only"
echo "Previous tag no v: $previous_server_tag_only"
IFS='.' read -r -a current <<< "${current_server_tag_only}"
IFS='.' read -r -a previous <<< "${previous_server_tag_only}"
Expand Down Expand Up @@ -185,14 +176,11 @@ jobs:
- name: build docker image
run: |
if [ "${{ inputs.repo }}" = "e-mission-server" ]; then
# docker build -t $DOCKER_USER/${{ inputs.repo }}:${{ steps.fetch-latest-release-tags.outputs.tag_name }} .
docker build -t ghcr.io/mukuflash03/${{ inputs.repo }}:${{ steps.fetch-latest-release-tags.outputs.tag_name }} .
elif [ "${{ inputs.repo }}" = "nrel-openpath-join-page" ]; then
if [ "${{ github.event_name }}" == "release" ]; then
# docker build -t $DOCKER_USER/${{ inputs.repo }}:${{ steps.fetch-latest-release-tags.outputs.tag_name }} ./frontend
docker build -t ghcr.io/mukuflash03/${{ 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
docker build -t ghcr.io/mukuflash03/${{ inputs.repo }}:${{ steps.increment-release-tag.outputs.new_repo_version }} ./frontend
fi
elif [ "${{ inputs.repo }}" = "op-admin-dashboard" ]; then
Expand All @@ -207,20 +195,15 @@ jobs:
run: |
if [ "${{ inputs.repo }}" = "op-admin-dashboard" ]; 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 tag e-mission/opdash:0.0.1 ghcr.io/mukuflash03/${{ inputs.repo }}:${{ 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 tag e-mission/opdash:0.0.1 ghcr.io/mukuflash03/${{ inputs.repo }}:${{ steps.increment-release-tag.outputs.new_repo_version }}
fi
elif [ "${{ inputs.repo }}" = "em-public-dashboard" ]; 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 tag em-pub-dash-prod/frontend:latest ghcr.io/mukuflash03/${{ inputs.repo }}_frontend:${{ steps.fetch-latest-release-tags.outputs.tag_name }}
docker tag em-pub-dash-prod/viz-scripts:latest ghcr.io/mukuflash03/${{ inputs.repo }}_notebook:${{ steps.fetch-latest-release-tags.outputs.tag_name }}
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
# docker image tag em-pub-dash-prod/viz-scripts:latest $DOCKER_USER/${{ inputs.repo }}_notebook:${{ steps.increment-release-tag.outputs.new_repo_version }}
docker tag em-pub-dash-prod/viz-scripts:latest ghcr.io/mukuflash03/${{ inputs.repo }}_notebook:${{ steps.increment-release-tag.outputs.new_repo_version }}
fi
fi
Expand All @@ -230,24 +213,18 @@ jobs:
run: |
if [ "${{ inputs.repo }}" = "em-public-dashboard" ]; 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 ghcr.io/mukuflash03/${{ inputs.repo }}_frontend:${{ steps.fetch-latest-release-tags.outputs.tag_name }}
docker push ghcr.io/mukuflash03/${{ inputs.repo }}_notebook:${{ steps.fetch-latest-release-tags.outputs.tag_name }}
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
# docker push $DOCKER_USER/${{ inputs.repo }}_notebook:${{ steps.increment-release-tag.outputs.new_repo_version }}
docker push ghcr.io/mukuflash03/${{ inputs.repo }}_notebook:${{ 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 }}" == "release" ]; then
# docker push $DOCKER_USER/${{ inputs.repo }}:${{ steps.fetch-latest-release-tags.outputs.tag_name }}
docker push ghcr.io/mukuflash03/${{ inputs.repo }}:${{ steps.fetch-latest-release-tags.outputs.tag_name }}
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
# docker push $DOCKER_USER/${{ inputs.repo }}:${{ steps.increment-release-tag.outputs.new_repo_version }}
docker push ghcr.io/mukuflash03/${{ inputs.repo }}:${{ steps.increment-release-tag.outputs.new_repo_version }}
fi
else
# docker push $DOCKER_USER/${{ inputs.repo }}:${{ steps.fetch-latest-release-tags.outputs.tag_name }}
docker push ghcr.io/mukuflash03/${{ inputs.repo }}:${{ steps.fetch-latest-release-tags.outputs.tag_name }}
fi
Expand Down

0 comments on commit 88caacb

Please sign in to comment.