From 2306ed1d95b5755e3cdff8068bbb42c2b9c633b5 Mon Sep 17 00:00:00 2001 From: Stefan <76208574+st-vi@users.noreply.github.com> Date: Wed, 18 Oct 2023 10:46:56 +0200 Subject: [PATCH] Create node.js.yml --- .github/workflows/node.js.yml | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..9b9232c --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,39 @@ +name: Deploy WebSocket Language Server + +env: + HOSTNAME: 590c9306-8ced-48f6-85f2-bb8caa1bfd52.ul.bw-cloud-instance.org + +on: + push: + branches: + - master + paths: + - 'WebSocketLanguageServer/**' + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install SSH key + run: | + mkdir -p ~/.ssh + 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 directory to remote server + run: | + scp -r ./WebSocketLanguageServer ubuntu@590c9306-8ced-48f6-85f2-bb8caa1bfd52.ul.bw-cloud-instance.org:/home/ubuntu/WebSocketLanguageServer + env: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + - name: Run remote script + run: | + ssh -i ~/.ssh/id_rsa ubuntu@590c9306-8ced-48f6-85f2-bb8caa1bfd52.ul.bw-cloud-instance.org 'bash /home/ubuntu/WebSocketLanguageServer/deployment.sh' + env: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}