diff --git a/.github/workflows/playground_deployment_dev.yml b/.github/workflows/playground_deployment_dev.yml new file mode 100644 index 0000000..00c7f9b --- /dev/null +++ b/.github/workflows/playground_deployment_dev.yml @@ -0,0 +1,49 @@ +name: Deploy UVL Playground + +env: + HOSTNAME: 7470a63e-7b47-4833-a06c-1513f4fc534d.ul.bw-cloud-instance.org + USERNAME: ubuntu + WORKDIR: /home/ubuntu + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + EMAIL: uvl-playground@trash-mail.com + +on: + push: + branches: + - dev + pull_request: + branches: + - dev + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Set hostname for WebSocketLanguageServer + run: | + sed -i "s/languageServerHostName: .*/languageServerHostName: \"$HOSTNAME\",/" ./WebSocketClient/src/config.ts + sed -i "s/debug: .*/debug: false,/" ./WebSocketClient/src/config.ts + - name: Set hostname mail for docker compose + run: | + echo "HOSTNAME=$HOSTNAME" > .env + echo "EMAIL=$EMAIL" >> .env + - 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 + - name: Copy all necessary files to remote server + # Make sure to add the following command if dependencies change for the language server. It just takes forever + # scp -r ./WebSocketClient/UVLPlayground/node_modules $USERNAME@$HOSTNAME:$WORKDIR/WebSocketClient/UVLPlayground + run: | + scp -r ./WebSocketLanguageServer $USERNAME@$HOSTNAME:$WORKDIR + scp -r ./WebSocketClient $USERNAME@$HOSTNAME:$WORKDIR/WebSocketClient + scp -r ./docker-compose.yaml $USERNAME@$HOSTNAME:$WORKDIR + scp -r ./.env $USERNAME@$HOSTNAME:$WORKDIR + - name: Build and run containers + run: ssh -i ~/.ssh/id_rsa $USERNAME@$HOSTNAME 'pwd && docker compose up --build -d' diff --git a/.github/workflows/playground_deployment_prod.yml b/.github/workflows/playground_deployment_prod.yml new file mode 100644 index 0000000..97d9691 --- /dev/null +++ b/.github/workflows/playground_deployment_prod.yml @@ -0,0 +1,49 @@ +name: Deploy UVL Playground + +env: + HOSTNAME: 55568392-f169-4f7f-b552-57cf451a2d81.ul.bw-cloud-instance.org + USERNAME: ubuntu + WORKDIR: /home/ubuntu + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + EMAIL: uvl-playground@trash-mail.com + +on: + push: + branches: + - master + pull_request: + branches: + - master + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Set hostname for WebSocketLanguageServer + run: | + sed -i "s/languageServerHostName: .*/languageServerHostName: \"$HOSTNAME\",/" ./WebSocketClient/src/config.ts + sed -i "s/debug: .*/debug: false,/" ./WebSocketClient/src/config.ts + - name: Set hostname mail for docker compose + run: | + echo "HOSTNAME=$HOSTNAME" > .env + echo "EMAIL=$EMAIL" >> .env + - 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 + - name: Copy all necessary files to remote server + # Make sure to add the following command if dependencies change for the language server. It just takes forever + # scp -r ./WebSocketClient/UVLPlayground/node_modules $USERNAME@$HOSTNAME:$WORKDIR/WebSocketClient/UVLPlayground + run: | + scp -r ./WebSocketLanguageServer $USERNAME@$HOSTNAME:$WORKDIR + scp -r ./WebSocketClient $USERNAME@$HOSTNAME:$WORKDIR/WebSocketClient + scp -r ./docker-compose.yaml $USERNAME@$HOSTNAME:$WORKDIR + scp -r ./.env $USERNAME@$HOSTNAME:$WORKDIR + - name: Build and run containers + run: ssh -i ~/.ssh/id_rsa $USERNAME@$HOSTNAME 'pwd && docker compose up --build -d' diff --git a/README.MD b/README.MD index 4898879..a3083c9 100644 --- a/README.MD +++ b/README.MD @@ -1,6 +1,8 @@ # UVL Playground -[![Website https://590c9306-8ced-48f6-85f2-bb8caa1bfd52.ul.bw-cloud-instance.org/](https://img.shields.io/website-up-down-green-red/https/perso.crans.org.svg)](https://590c9306-8ced-48f6-85f2-bb8caa1bfd52.ul.bw-cloud-instance.org/) +[![Production Website https://55568392-f169-4f7f-b552-57cf451a2d81.ul.bw-cloud-instance.org/](https://img.shields.io/website-up-down-green-red/https/perso.crans.org.svg)](https://55568392-f169-4f7f-b552-57cf451a2d81.ul.bw-cloud-instance.org/) + +[![Development Website https://7470a63e-7b47-4833-a06c-1513f4fc534d.ul.bw-cloud-instance.org/](https://img.shields.io/website-up-down-green-red/https/perso.crans.org.svg)](https://7470a63e-7b47-4833-a06c-1513f4fc534d.ul.bw-cloud-instance.org/) This project contains the code for the UVL playground, a small website that uses the [UVLS](https://github.com/Universal-Variability-Language/uvl-lsp) to provide syntax highlighting, autocompletion and simple analysis. It consists of static website utilizing the [monaco editor](https://github.com/microsoft/monaco-editor) und communicates via websockets with the language server by using the [monaco-languageclient package](https://github.com/TypeFox/monaco-languageclient).