Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
adetyaz committed Nov 30, 2024
2 parents b2590e1 + 6fd8c54 commit e3f1694
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ on:
push:
branches:
- prod
pull_request:
branches:
- prod
- main

jobs:
next-build:
Expand Down Expand Up @@ -52,9 +50,10 @@ jobs:
rm -rf .env
ghcr-push:
needs: next-build # Job depends on next-build(above) job
needs: next-build
runs-on: ubuntu-latest
steps:
# Deploy to Production server
- name: Deploy on Production server
if: github.ref == 'refs/heads/prod'
uses: appleboy/[email protected]
Expand All @@ -70,3 +69,20 @@ jobs:
echo ${{ secrets.GHCR_TOKEN }} | sudo docker login ghcr.io -u ${{ secrets.GHCR_USERNAME }} --password-stdin
sudo docker pull ghcr.io/myriadflow/webxr:prod
sudo docker run --name="webxr" -p 8080:3000 -d ghcr.io/myriadflow/webxr:prod
# Deploy to Development server
- name: Deploy on Development server
if: github.ref == 'refs/heads/main'
uses: appleboy/[email protected]
with:
host: ${{ secrets.DEV_REMOTE_SERVER_ADDRESS }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.DEV_REMOTE_SERVER_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
pwd
cd ~
sudo docker stop webxr && sudo docker rm webxr && sudo docker rmi ghcr.io/myriadflow/webxr:main
echo ${{ secrets.GHCR_TOKEN }} | sudo docker login ghcr.io -u ${{ secrets.GHCR_USERNAME }} --password-stdin
sudo docker pull ghcr.io/myriadflow/webxr:main
sudo docker run --name="webxr" -p 8080:3000 -d ghcr.io/myriadflow/webxr:main
File renamed without changes.

0 comments on commit e3f1694

Please sign in to comment.