-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07571ee
commit 26cf519
Showing
1 changed file
with
10 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -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: | | ||
|