Skip to content

Commit

Permalink
added workflow for dev environment
Browse files Browse the repository at this point in the history
  • Loading branch information
st-vi committed Nov 14, 2023
1 parent b829bb1 commit 9324974
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 1 deletion.
49 changes: 49 additions & 0 deletions .github/workflows/playground_deployment_dev.yml
Original file line number Diff line number Diff line change
@@ -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: [email protected]

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'
49 changes: 49 additions & 0 deletions .github/workflows/playground_deployment_prod.yml
Original file line number Diff line number Diff line change
@@ -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: [email protected]

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'
4 changes: 3 additions & 1 deletion README.MD
Original file line number Diff line number Diff line change
@@ -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).

Expand Down

0 comments on commit 9324974

Please sign in to comment.