Skip to content

test(traefik): pushing new config #23

test(traefik): pushing new config

test(traefik): pushing new config #23

name: Deploy UVL Playground Dev
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@v4
with:
ref: dev
- run: git branch -a
- run: cat ./WebSocketClient/index.html
- 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: |
rsync -avz --update ./WebSocketLanguageServer $USERNAME@$HOSTNAME:$WORKDIR
rsync -avz --update ./WebSocketClient $USERNAME@$HOSTNAME:$WORKDIR
rsync -avz --update ./docker-compose.yaml $USERNAME@$HOSTNAME:$WORKDIR
rsync -avz --update ./.env $USERNAME@$HOSTNAME:$WORKDIR
- name: Build and run containers
run: ssh -i ~/.ssh/id_rsa $USERNAME@$HOSTNAME 'pwd && docker compose up --build -d'