Skip to content

Commit

Permalink
update ssh
Browse files Browse the repository at this point in the history
  • Loading branch information
owenowenisme committed Dec 10, 2024
1 parent 07571ee commit 26cf519
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions .github/workflows/frontend-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/pastexam/frontend
TAG: latest
DEV_HOST: 10.2.0.53

jobs:
ssh-into-server:
Expand All @@ -27,23 +26,16 @@ jobs:
run: |
sudo wg-quick up pastexam-dev
- name: SSH into server
run: |
echo "{{ secrets.DEV_SSHKEY }}" > /tmp/pastexam-dev.pem
chmod 600 /tmp/pastexam-dev.pem
ssh -i /tmp/pastexam-dev.pem [email protected]
- name: Pull the docker image
run: |
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
- name: Stop the original container
run: |
docker stop pastexam-frontend >> /dev/null 2>&1
- name: Run the new container
run: |
docker run -p 3000:3000 -d --name pastexam-frontend --restart always ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
- name: Deploy frontend
uses: appleboy/[email protected]
with:
host: ${{ secrets.DEV_HOST }}
username: ${{ secrets.DEV_USERNAME }}
key: ${{ secrets.DEV_SSHKEY }}
script: |
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
docker stop pastexam-frontend >> /dev/null 2>&1
docker run -p 3000:3000 -d --name pastexam-frontend --restart always ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
- name: Disconnect from WireGuard
run: |
Expand Down

0 comments on commit 26cf519

Please sign in to comment.