Skip to content

Commit

Permalink
updating reposetory
Browse files Browse the repository at this point in the history
  • Loading branch information
p-shubh committed Jun 16, 2024
1 parent 1b9aae5 commit 0d2cca4
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/deloyment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
# - backend

jobs:
Deploy:
Expand All @@ -25,14 +24,12 @@ jobs:
env:
DEV_ENV_FILE: ${{ secrets.ENV_FILE }}
run: |
echo "$ENV_FILE" > .env
export CURRENT_BRANCH=${GITHUB_REF#refs/heads/}
echo "$DEV_ENV_FILE" > .env
export CURRENT_BRANCH=$(echo ${GITHUB_REF#refs/heads/} | tr '[:upper:]' '[:lower:]')
export TAG=$([[ $CURRENT_BRANCH == $(basename ${{ github.ref }}) ]] && echo $CURRENT_BRANCH || echo "latest")
echo $TAG
export GITHUB_REF_IMAGE=ghcr.io/$GITHUB_REPOSITORY:$GITHUB_SHA
export GITHUB_BRANCH_IMAGE=ghcr.io/$GITHUB_REPOSITORY:$TAG
# export GITHUB_REF_IMAGE=$(echo $GITHUB_REF_IMAGE | tr '[:upper:]' '[:lower:]')
# export GITHUB_BRANCH_IMAGE=$(echo $GITHUB_BRANCH_IMAGE | tr '[:upper:]' '[:lower:]')
export GITHUB_REF_IMAGE=$(echo ghcr.io/$GITHUB_REPOSITORY:$GITHUB_SHA | tr '[:upper:]' '[:lower:]')
export GITHUB_BRANCH_IMAGE=$(echo ghcr.io/$GITHUB_REPOSITORY:$TAG | tr '[:upper:]' '[:lower:]')
docker build --build-arg version=$GITHUB_SHA -t $GITHUB_REF_IMAGE -t $GITHUB_BRANCH_IMAGE .
echo "Pushing Frontend Image to GitHub Container Registry"
docker push $GITHUB_REF_IMAGE
Expand All @@ -52,4 +49,4 @@ jobs:
sudo docker discover || true && sudo docker image rm ghcr.io/p-shubh/discover:main
echo ${{ secrets.GHCR_TOKEN }} | sudo docker login ghcr.io -u ${{ secrets.GHCR_USERNAME }} --password-stdin
sudo docker pull ghcr.io/p-shubh/sui_overflow_hack:main
sudo docker run --name="discover" --rm -p 4040:6060 --net=bridge -d ghcr.io/p-shubh/discover:main
sudo docker run --name="discover" --rm -p 4040:6060 --net=bridge -d ghcr.io/p-shubh/discover:main

0 comments on commit 0d2cca4

Please sign in to comment.