Skip to content

Commit

Permalink
Update deploy-dev.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
p-shubh authored Aug 7, 2024
1 parent 45a9e61 commit f8271da
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Check DEV_EREBRUS_FRONTEND
run: |
if [ -z "$DEV_EREBRUS_FRONTEND" ]; then
echo "DEV_EREBRUS_FRONTEND is not set. Stopping the workflow."
exit 1
fi
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
Expand All @@ -29,9 +22,10 @@ jobs:

- name: Build and Push Docker Image for Main
env:
DEV_ENV_FILE: ${{ secrets.DEV_EREBRUS_FRONTEND }}
DEV_ENV_FILE: ${{ vars.DEV_EREBRUS_FRONTEND }}
run: |
echo "$DEV_EREBRUS_FRONTEND" > .env
cat .env
export CURRENT_BRANCH=${GITHUB_REF#refs/heads/}
export TAG=$([[ $CURRENT_BRANCH == $(basename ${{ github.ref }}) ]] && echo $CURRENT_BRANCH || echo "latest")
echo $TAG
Expand All @@ -54,3 +48,11 @@ jobs:
uses: appleboy/ssh-action@v0.1.7
with:
host: ${{ secrets.DEV_REMOTE_SERVER_ADDRESS }}
username: ${{ secrets.DEV_SERVER_USERNAME }}
key: ${{ secrets.DEV_REMOTE_SERVER_KEY }}
port: ${{ secrets.DEV_SSH_PORT }}
script: |
docker stop erebrus-frontend || true && docker image rm ghcr.io/netsepio/erebrus-frontend:main
echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u ${{ secrets.GHCR_USERNAME }} --password-stdin
docker pull ghcr.io/netsepio/erebrus-frontend:main
docker run --name="erebrus-frontend" --rm -p 4040:8080 --net=bridge -d ghcr.io/netsepio/erebrus-frontend:main

0 comments on commit f8271da

Please sign in to comment.