From 3e01110204d1af5cc2820a8081be16150fe53d4e Mon Sep 17 00:00:00 2001 From: JannisDommer Date: Fri, 3 Nov 2023 12:17:35 +0100 Subject: [PATCH 1/3] feat(docker): restart on failure --- docker-compose.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yaml b/docker-compose.yaml index 9a3675c..d58d6f5 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -12,5 +12,6 @@ services: build: context: ./WebSocketClient/UVLPlayground dockerfile: Dockerfile + restart: on-failure ports: - "8000:80" \ No newline at end of file From 048337d76ab5c4ec2fa4e749c12b5e8e3a2aac4c Mon Sep 17 00:00:00 2001 From: JannisDommer Date: Fri, 3 Nov 2023 12:19:40 +0100 Subject: [PATCH 2/3] feat(docker): restart on failure --- docker-compose.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yaml b/docker-compose.yaml index d58d6f5..3493838 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -5,6 +5,7 @@ services: context: ./WebSocketLanguageServer dockerfile: Dockerfile hostname: language-server + restart: on-failure ports: - "30000:30000" From a8007e81155928c01310f2475616ceb4e06eaa82 Mon Sep 17 00:00:00 2001 From: JannisDommer Date: Fri, 3 Nov 2023 12:25:12 +0100 Subject: [PATCH 3/3] refactor(docker): cut down github action --- .github/workflows/playground_deployment.yml | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/playground_deployment.yml b/.github/workflows/playground_deployment.yml index ed39b61..cc12e61 100644 --- a/.github/workflows/playground_deployment.yml +++ b/.github/workflows/playground_deployment.yml @@ -4,6 +4,7 @@ env: HOSTNAME: 590c9306-8ced-48f6-85f2-bb8caa1bfd52.ul.bw-cloud-instance.org USERNAME: ubuntu WORKDIR: /home/ubuntu + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} on: push: @@ -36,20 +37,11 @@ jobs: echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa ssh-keyscan -H $HOSTNAME >> ~/.ssh/known_hosts - env: - SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} - - name: Copy directories to remote server + - name: Copy all necessary files to remote server run: | scp -r ./WebSocketLanguageServer $USERNAME@$HOSTNAME:$WORKDIR scp -r ./WebSocketClient/UVLPlayground/dist $USERNAME@$HOSTNAME:$WORKDIR/WebSocketClient/UVLPlayground - env: - SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} - - name: Copy Dockerfile to remote server - run: scp -r ./WebSocketClient/UVLPlayground/Dockerfile $USERNAME@$HOSTNAME:$WORKDIR/WebSocketClient/UVLPlayground - - name: Copy Compose file - run: scp -r ./docker-compose.yaml $USERNAME@$HOSTNAME:$WORKDIR + scp -r ./WebSocketClient/UVLPlayground/Dockerfile $USERNAME@$HOSTNAME:$WORKDIR/WebSocketClient/UVLPlayground + scp -r ./docker-compose.yaml $USERNAME@$HOSTNAME:$WORKDIR - name: Build and run containers - run: | - ssh -i ~/.ssh/id_rsa $USERNAME@$HOSTNAME 'pwd && docker compose up --build -d' - env: - SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + run: ssh -i ~/.ssh/id_rsa $USERNAME@$HOSTNAME 'pwd && docker compose up --build -d' \ No newline at end of file