feat: changed readme #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |